home *** CD-ROM | disk | FTP | other *** search
/ Aminet 4 / Aminet 4 - November 1994.iso / aminet / dev / obero / oberon_lib.lha / oberon-a / source1.lha / source / Amiga / Graphics.mod < prev    next >
Text File  |  1994-08-08  |  111KB  |  3,382 lines

  1. (***************************************************************************
  2.  
  3.      $RCSfile: Graphics.mod $
  4.   Description: Interface to graphics.library
  5.  
  6.    Created by: fjc (Frank Copeland)
  7.     $Revision: 3.2 $
  8.       $Author: fjc $
  9.         $Date: 1994/08/08 00:54:05 $
  10.  
  11.   Includes Release 40.15
  12.  
  13.   (C) Copyright 1985-1993 Commodore-Amiga, Inc.
  14.       All Rights Reserved
  15.  
  16.   Oberon-A interface Copyright © 1994, Frank Copeland.
  17.   This file is part of the Oberon-A Interface.
  18.   See Oberon-A.doc for conditions of use and distribution.
  19.  
  20. ***************************************************************************)
  21.  
  22. MODULE Graphics;
  23.  
  24. (*
  25. ** $C- CaseChk       $I- IndexChk  $L+ LongAdr   $N- NilChk
  26. ** $P- PortableCode  $R- RangeChk  $S- StackChk  $T- TypeChk
  27. ** $V- OvflChk       $Z- ZeroVars
  28. *)
  29.  
  30. IMPORT E := Exec, H := Hardware, U := Utility, SYS := SYSTEM;
  31.  
  32. (**
  33. **      All pointers are declared forward here for convenience.
  34. *)
  35.  
  36. TYPE
  37.  
  38.   RectanglePtr *            = CPOINTER TO Rectangle;
  39.   Rect32Ptr *               = CPOINTER TO Rect32;
  40.   PointPtr *                = CPOINTER TO Point;
  41.   BitMapPtr *               = CPOINTER TO BitMap;
  42.   ExtendedNodePtr *         = CPOINTER TO ExtendedNode;
  43.   AnalogSignalIntervalPtr * = CPOINTER TO AnalogSignalInterval;
  44.   SpecialMonitorPtr *       = CPOINTER TO SpecialMonitor;
  45.   MonitorSpecPtr *          = CPOINTER TO MonitorSpec;
  46.   QueryHeaderPtr *          = CPOINTER TO QueryHeader;
  47.   DisplayInfoPtr *          = CPOINTER TO DisplayInfo;
  48.   DimensionInfoPtr *        = CPOINTER TO DimensionInfo;
  49.   MonitorInfoPtr *          = CPOINTER TO MonitorInfo;
  50.   NameInfoPtr *             = CPOINTER TO NameInfo;
  51.   VSpritePtr *              = CPOINTER TO VSprite;
  52.   BobPtr *                  = CPOINTER TO Bob;
  53.   AnimCompPtr *             = CPOINTER TO AnimComp;
  54.   DBufPacketPtr *           = CPOINTER TO DBufPacket;
  55.   AnimObPtr *               = CPOINTER TO AnimOb;
  56.   CollTablePtr *            = CPOINTER TO CollTable;
  57.   AreaInfoPtr *             = CPOINTER TO AreaInfo;
  58.   TmpRasPtr *               = CPOINTER TO TmpRas;
  59.   GelsInfoPtr *             = CPOINTER TO GelsInfo;
  60.   RastPortPtr *             = CPOINTER TO RastPort;
  61.   CopInsPtr *               = CPOINTER TO CopIns;
  62.   CopInsCLPtr *             = CPOINTER TO CopInsCL;
  63.   CprlistPtr *              = CPOINTER TO Cprlist;
  64.   CopListPtr *              = CPOINTER TO CopList;
  65.   CopList13Ptr *            = CPOINTER TO CopList13;
  66.   UCopListPtr *             = CPOINTER TO UCopList;
  67.   ViewPortPtr *             = CPOINTER TO ViewPort;
  68.   ViewPtr *                 = CPOINTER TO View;
  69.   ViewExtraPtr *            = CPOINTER TO ViewExtra;
  70.   ViewPortExtraPtr *        = CPOINTER TO ViewPortExtra;
  71.   RasInfoPtr *              = CPOINTER TO RasInfo;
  72.   ColorMapPtr *             = CPOINTER TO ColorMap;
  73.   LayerInfoPtr *            = CPOINTER TO LayerInfo;
  74.   LayerPtr *                = CPOINTER TO Layer;
  75.   ClipRectPtr *             = CPOINTER TO ClipRect;
  76.   RegionRectanglePtr *      = CPOINTER TO RegionRectangle;
  77.   RegionPtr *               = CPOINTER TO Region;
  78.   SimpleSpritePtr *         = CPOINTER TO SimpleSprite;
  79.   TextAttrPtr *             = CPOINTER TO TextAttr;
  80.   TTextAttrPtr *            = CPOINTER TO TTextAttr;
  81.   TextFontPtr *             = CPOINTER TO TextFont;
  82.   TextFontExtensionPtr *    = CPOINTER TO TextFontExtension;
  83.   ColorFontColorsPtr *      = CPOINTER TO ColorFontColors;
  84.   ColorTextFontPtr *        = CPOINTER TO ColorTextFont;
  85.   TextExtentPtr *           = CPOINTER TO TextExtent;
  86.   IsrvstrPtr *              = CPOINTER TO Isrvstr;
  87.   BitScaleArgsPtr *         = CPOINTER TO BitScaleArgs;
  88.   CopListBasePtr *          = CPOINTER TO CopListBasePtr;
  89.   PaletteExtraPtr *         = CPOINTER TO PaletteExtra;
  90.   DBufInfoPtr *             = CPOINTER TO DBufInfo;
  91.   ExtSpritePtr *            = CPOINTER TO ExtSprite;
  92.  
  93.  
  94. (*
  95. **      $VER: gfx.h 39.5 (19.3.92)
  96. **
  97. **      general graphics library definitions
  98. *)
  99.  
  100. CONST
  101.  
  102.   bitSet * = {15};
  103.   bitClr * = {};
  104.  
  105. TYPE
  106.  
  107.   Rectangle * = RECORD
  108.     minX *, minY * : INTEGER;
  109.     maxX *, maxY * : INTEGER;
  110.   END; (* Rectangle *)
  111.  
  112.   Rect32 * = RECORD
  113.     minX *, minY * : LONGINT;
  114.     maxX *, maxY * : LONGINT;
  115.   END; (* Rect32 *)
  116.  
  117.   Point * = RECORD
  118.     x *, y * : INTEGER;
  119.   END; (* Point *)
  120.  
  121.   PlanePtr * = E.APTR;
  122.  
  123.   BitMap * = RECORD
  124.     bytesPerRow * : E.UWORD;
  125.     rows *        : E.UWORD;
  126.     flags *       : E.BSET;
  127.     depth *       : E.UBYTE;
  128.     pad *         : E.UWORD;
  129.     planes *      : ARRAY 8 OF PlanePtr;
  130.   END; (* BitMap *)
  131.  
  132. CONST
  133.  
  134. (* flags for AllocBitMap, etc. *)
  135.   bmClear       * = 0;
  136.   bmDisplayable * = 1;
  137.   bmInterleaved * = 2;
  138.   bmStandard    * = 3;
  139.   bmMinPlanes   * = 4;
  140.  
  141. (* the following are for GetBitMapAttr() *)
  142.   bmaHeight * = 0;
  143.   bmaDepth  * = 4;
  144.   bmaWidth  * = 8;
  145.   bmaFlags  * = 12;
  146.  
  147. (*
  148. **      $VER: gfxnodes.h 39.0 (21.8.91)
  149. **
  150. **      graphics extended node definintions
  151. *)
  152.  
  153. TYPE
  154.  
  155.   ExtendedNode * = RECORD (E.Node)
  156.     subsystem * : E.UBYTE;
  157.     subtype *   : E.UBYTE;
  158.     library *   : LONGINT;
  159.     init *      : E.PROC;
  160.   END; (* ExtendedNode *)
  161.  
  162. CONST
  163.  
  164.   ssGraphics *    = 02H;
  165.  
  166.   viewExtraType *        = 1;
  167.   viewPortExtraType *    = 2;
  168.   specialMonitorType *   = 3;
  169.   monitorSpecType *      = 4;
  170.  
  171.  
  172. (*
  173. **      $VER: monitor.h 39.7 (9.6.92)
  174. **
  175. **      graphics monitorspec definintions
  176. *)
  177.  
  178. TYPE
  179.  
  180.   LONGPROC * = PROCEDURE () : LONGINT;
  181.  
  182.   MonitorSpec * = RECORD (ExtendedNode)
  183.     msFlags *                : E.WSET;
  184.     ratioh *                 : LONGINT;
  185.     ratiov *                 : LONGINT;
  186.     totalRows *              : E.UWORD;
  187.     totalColorClocks *       : E.UWORD;
  188.     deniseMaxDisplayColumn * : E.UWORD;
  189.     beamCon0 *               : E.UWORD;
  190.     minRow *                 : E.UWORD;
  191.     special *                : SpecialMonitorPtr;
  192.     openCount *              : E.UWORD;
  193.     transform *              : LONGPROC;
  194.     translate *              : LONGPROC;
  195.     scale *                  : LONGPROC;
  196.     xoffset *                : E.UWORD;
  197.     yoffset *                : E.UWORD;
  198.     legalView *              : Rectangle;
  199.     maxoscan *               : LONGPROC; (* maximum legal overscan *)
  200.     videoscan *              : LONGPROC; (* video display overscan *)
  201.     deniseMinDisplayColumn * : E.UWORD;
  202.     displayCompatible *      : E.ULONG;
  203.     displayInfoDataBase *    : E.List;
  204.     displayInfoDataBaseSemaphore * : E.SignalSemaphore;
  205.     mrgCop *                 : LONGPROC;
  206.     loadView *               : LONGPROC;
  207.     killView *               : LONGPROC;
  208.   END; (* MonitorSpec *)
  209.  
  210. CONST
  211.  
  212.   toMonitor *       = 0;
  213.   fromMonitor *     = 1;
  214.   standardXOffset * = 9;
  215.   standardYOffset * = 0;
  216.  
  217.   msRequestNTSC    * = 0;
  218.   msRequestPAL     * = 1;
  219.   msRequestSpecial * = 2;
  220.   msRequestA2024   * = 3;
  221.   msDoubleSprites  * = 4;
  222.  
  223. (* obsolete, v37 compatible definitions follow *)
  224.   requestNTSC *     = 1;
  225.   requestPAL *      = 2;
  226.   requestSpecial *  = 4;
  227.   requestA2024 *    = 8;
  228.  
  229.   defaultMonitorName *    = "default.monitor";
  230.   ntscMonitorName *       = "ntsc.monitor";
  231.   palMonitorName *        = "pal.monitor";
  232.   standardMonitorMask *   = requestNTSC + requestPAL;
  233.  
  234.   standardNTSCRows *      = 262;
  235.   standardPALRows *       = 312;
  236.   standardColorClocks *   = 226;
  237.   standardDeniseMax *     = 455;
  238.   standardDeniseMin *     = 93;
  239.   standardNTSCBeamCon *   = {};
  240.   standardPALBeamCon *    = {H.displayPAL};
  241.  
  242.   specialBeamcon * =
  243.     { H.varVBlank, H.loLDis, H.varVSync,
  244.       H.varHSync, H.varBeam, H.csBlank, H.vSyncTrue };
  245.  
  246.   minNTSCRow *      = 21;
  247.   minPALRow *       = 29;
  248.   standardViewX *   = 81H;
  249.   standardViewY *   = 2CH;
  250.   standardHBstrt *  = 06H;
  251.   standardHSstrt *  = 0BH;
  252.   standardHSstop *  = 1CH;
  253.   standardHBstop *  = 2CH;
  254.   standardVBstrt *  = 0122H;
  255.   standardVSstrt *  = 02A6H;
  256.   standardVSstop *  = 03AAH;
  257.   standardVBstop *  = 1066H;
  258.  
  259.   vgaColorClocks *  = standardColorClocks DIV 2;
  260.   vgaTotalRows *    = standardNTSCRows *  2;
  261.   vgaDeniseMin *    = 59;
  262.   minVgaRow *       = 29;
  263.   vgaHBstrt *       = 08H;
  264.   vgaHSstrt *       = 0EH;
  265.   vgaHSstop *       = 1CH;
  266.   vgaHBstop *       = 1EH;
  267.   vgaVBstrt *       = 0000H;
  268.   vgaVSstrt *       = 0153H;
  269.   vgaVSstop *       = 0235H;
  270.   vgaVBstop *       = 0CCDH;
  271.  
  272.   vgaMonitorName *    = "vga.monitor";
  273.  
  274. (* NOTE: VGA70 definitions are obsolete - a VGA70 monitor has never been
  275.  * implemented.
  276.  *)
  277.   vga70ColorClocks *  = standardColorClocks DIV 2;
  278.   vga70TotalRows *    = 449;
  279.   vga70DeniseMin *    = 59;
  280.   minVga70Row *       = 35;
  281.   vga70HBstrt *       = 08H;
  282.   vga70HSstrt *       = 0EH;
  283.   vga70HSstop *       = 1CH;
  284.   vga70HBstop *       = 1EH;
  285.   vga70VBstrt *       = 0000H;
  286.   vga70VSstrt *       = 02A6H;
  287.   vga70VSstop *       = 0388H;
  288.   vga70VBstop *       = 0F73H;
  289.  
  290.   vga70beamcon *      = specialBeamcon / { H.vSyncTrue };
  291.   vga70MonitorName *  = "vga70.monitor";
  292.  
  293.   broadcastHBstrt *        = 01H;
  294.   broadcastHSstrt *        = 06H;
  295.   broadcastHSstop *        = 17H;
  296.   broadcastHBstop *        = 27H;
  297.   broadcastVBstrt *        = 0000H;
  298.   broadcastVSstrt *        = 02A6H;
  299.   broadcastVSstop *        = 054CH;
  300.   broadcastVBstop *        = 1C40H;
  301.   broadcastBeamCon *       = { H.loLDis, H.csBlank };
  302.   ratioFixedPart *         = 4;
  303.   ratioUnity *             = (*ASH (1, ratioFixedPart)*) 16;
  304.  
  305. TYPE
  306.  
  307.   AnalogSignalInterval * = RECORD
  308.     start * : E.UWORD;
  309.     stop *  : E.UWORD;
  310.   END; (* AnalogSignalInterval *)
  311.  
  312.   SpecialMonitor * = RECORD (ExtendedNode)
  313.     spmFlags *  : E.WSET;
  314.     doMonitor * : LONGPROC;
  315.     reserved1 * : LONGPROC;
  316.     reserved2 * : LONGPROC;
  317.     reserved3 * : LONGPROC;
  318.     hblank *    : AnalogSignalInterval;
  319.     vblank *    : AnalogSignalInterval;
  320.     hsync *     : AnalogSignalInterval;
  321.     vsync *     : AnalogSignalInterval;
  322.   END; (* SpecialMonitor *)
  323.  
  324.  
  325. (*
  326. **      $VER: display.h 39.0 (21.8.91)
  327. **
  328. **      definitions for display control registers
  329. *)
  330.  
  331.  
  332. CONST
  333.  
  334. (* bplcon0 defines *)
  335.   mode640 *      = 15;
  336.   plnCntMsk *    = {0..2};     (* how many bit planes? *)
  337.                                (* 0 = none, 1->6 = 1->6, 7 = reserved *)
  338.   plnCntShft *   = 12;         (* bits to shift for bplcon0 *)
  339.   pf2pri *       = 6;          (* bplcon2 bit *)
  340.   colorOn *      = 9;          (* disable color burst *)
  341.   dblpf *        = 10;
  342.   holdnmodify *  = 11;
  343.   interlace *    = 2;          (* interlace mode for 400 *)
  344.  
  345. (* bplcon1 defines *)
  346.   pfaFineScroll *      = {0..3};
  347.   pfbFineScrollShift * = 4;
  348.   pfFineScrollMask *  = {0..3};
  349.  
  350. (* display window start and stop defines *)
  351.   diwHorizPos *      = {0..6};      (* horizontal start/stop *)
  352.   diwVrtclPos *      = {0..8};      (* vertical start/stop *)
  353.   diwVrtclPosShift * = 7;
  354.  
  355. (* Data fetch start/stop horizontal position *)
  356.   dftchMask *       = {0..7};
  357.  
  358. (* vposr bits *)
  359.   vposrlof *        = {15};
  360.  
  361.  
  362.  
  363. (*
  364. **      $VER: displayinfo.h 39.13 (31.5.93)
  365. **
  366. **      definitions for displayinfo database
  367. *)
  368.  
  369.  
  370. TYPE
  371.  
  372. (* the "public" handle to a DisplayInfoRecord *)
  373.  
  374.   DisplayInfoHandle * = CPOINTER TO RECORD END;
  375.  
  376. CONST
  377.  
  378. (* datachunk type identifiers *)
  379.  
  380.   dtagDisp *               = 80000000H;
  381.   dtagDims *               = 80001000H;
  382.   dtagMntr *               = 80002000H;
  383.   dtagName *               = 80003000H;
  384.  
  385. TYPE
  386.  
  387.   QueryHeader * = RECORD
  388.     structID *  : E.ULONG;  (* datachunk type identifier *)
  389.     displayID * : E.ULONG;  (* copy of display record key   *)
  390.     skipID *    : E.ULONG;  (* tagSKIP -- see tagitems.h *)
  391.     length *    : E.ULONG;  (* length of local data in double-longwords *)
  392.   END; (* QueryHeader *)
  393.  
  394.   DisplayInfo * = RECORD (QueryHeader)
  395.     notAvailable *  : E.WSET;   (* if NULL available, else see defines *)
  396.     propertyFlags * : SET;      (* Properties of this mode see defines *)
  397.     resolution *    : Point;    (* ticks-per-pixel X/Y                 *)
  398.     pixelSpeed *    : E.UWORD;  (* aproximation in nanoseconds         *)
  399.     numStdSprites * : E.UWORD;  (* number of standard amiga sprites    *)
  400.     paletteRange *  : E.UWORD;  (* distinguishable shades available    *)
  401.     spriteResolution * : Point; (* std sprite ticks-per-pixel X/Y    *)
  402.     pad * : ARRAY 4 OF E.UBYTE; (* used internally *)
  403.     redBits *       : E.UBYTE;  (* number of Red bits this display supports (V39) *)
  404.     greenBits *     : E.UBYTE;  (* number of Green bits this display supports (V39) *)
  405.     blueBits *      : E.UBYTE;  (* number of Blue bits this display supports (V39) *)
  406.  (* pad2 * : ARRAY 5 OF E.UBYTE; (* find some use for this. *)
  407.     Allow for different alignment rules (?) *)
  408.     pad2 * : ARRAY 4 OF E.UBYTE; (* find some use for this. *)
  409.     reserved * : ARRAY 2 OF E.ULONG; (* terminator *)
  410.   END; (* DisplayInfo *)
  411.  
  412. CONST
  413.  
  414. (* availability *)
  415.  
  416.   diAvailNoChips *        = {0};
  417.   diAvailNoMonitor *      = {1};
  418.   diAvailNotWithGenlock * = {2};
  419.  
  420. (* mode properties *)
  421.  
  422.   dipIsLace *            = 0;
  423.   dipIsDualPF *          = 1;
  424.   dipIsPF2Pri *          = 2;
  425.   dipIsHAM *             = 3;
  426.  
  427.   dipIsECS *             = 4;  (*      note: ECS modes (SHIRES, VGA, and **
  428.                                 **      PRODUCTIVITY) do not support      **
  429.                                 **      attached sprites.                 **
  430.                                 *)
  431.  
  432.   dipIsAA *              = 16;  (* AA modes - may only be available
  433.                                 ** if machine has correct memory
  434.                                 ** type to support required
  435.                                 ** bandwidth - check availability.
  436.                                 ** (V39)
  437.                                 *)
  438.  
  439.   dipIsPAL     *          = 5;
  440.   dipIsSprites *          = 6;
  441.   dipIsGenlock *          = 7;
  442.  
  443.   dipIsWB *               = 8;
  444.   dipIsDraggable *        = 9;
  445.   dipIsPanelled *         = 10;
  446.   dipIsBeamSync *         = 11;
  447.  
  448.   dipIsExtraHalfBrite *   = 12;
  449.  
  450. (* The following dipIs... flags are new for V39 *)
  451.   dipIsSpritesAtt      * = 13;  (* supports attached sprites *)
  452.   dipIsSpritesChngRes  * = 14;  (* supports variable sprite resolution *)
  453.   dipIsSpritesBorder   * = 15;  (* sprite can be displayed in the border *)
  454.   dipIsScanDbl         * = 17;  (* scan doubled *)
  455.   dipIsSpritesChngBase * = 18;
  456.   dipIsSpritesChngPri  * = 19;
  457.   dipIsDBuffer         * = 20;  (* can support double buffering *)
  458.   dipIsProgBeam        * = 21;  (* is a programmed beam-sync mode *)
  459.   dipIsForeign         * = 31;  (* this mode is not native to the Amiga *)
  460.  
  461. TYPE
  462.  
  463.   DimensionInfo * = RECORD (QueryHeader)
  464.     maxDepth *        : E.UWORD;      (* log2( max number of colors ) *)
  465.     minRasterWidth *  : E.UWORD;      (* minimum width in pixels      *)
  466.     minRasterHeight * : E.UWORD;      (* minimum height in pixels     *)
  467.     maxRasterWidth *  : E.UWORD;      (* maximum width in pixels      *)
  468.     maxRasterHeight * : E.UWORD;      (* maximum height in pixels     *)
  469.     nominal *         : Rectangle;    (* "standard" dimensions        *)
  470.     maxOScan *        : Rectangle;    (* fixed, hardware dependant    *)
  471.     videoOScan *      : Rectangle;    (* fixed, hardware dependant    *)
  472.     txtOScan *        : Rectangle;    (* editable via preferences     *)
  473.     stdOScan *        : Rectangle;    (* editable via preferences     *)
  474.     pad *             : ARRAY 14 OF E.UBYTE;
  475.     reserved *        : ARRAY 2 OF E.ULONG;          (* terminator *)
  476.   END; (* DimensionInfo *)
  477.  
  478.   MonitorInfo * = RECORD (QueryHeader)
  479.     mspc *                : MonitorSpecPtr; (* pointer to monitor specification  *)
  480.     viewPosition *        : Point;          (* editable via preferences          *)
  481.     viewResolution *      : Point;          (* standard monitor ticks-per-pixel  *)
  482.     viewPositionRange *   : Rectangle;      (* fixed, hardware dependant *)
  483.     totalRows *           : E.UWORD;        (* display height in scanlines       *)
  484.     totalColorClocks *    : E.UWORD;        (* scanline width in 280 ns units    *)
  485.     minRow *              : E.UWORD;        (* absolute minimum active scanline  *)
  486.     compatibility *       : INTEGER;        (* how this coexists with others     *)
  487.     pad *                 : ARRAY 36 OF E.UBYTE;
  488.     defaultViewPosition * : Point;          (* original, never changes *)
  489.     preferredModeID *     : E.ULONG;        (* for Preferences *)
  490.     reserved *            : ARRAY 2 OF E.ULONG;          (* terminator *)
  491.   END; (* MonitorInfo *)
  492.  
  493. CONST
  494.  
  495. (* monitor compatibility *)
  496.  
  497.   mCompatMixed *   = 0;      (* can share display with other mcompatMIXED *)
  498.   mCompatSelf *    = 1;      (* can share only within same monitor *)
  499.   mCompatNobody *  = -1;     (* only one viewport at a time *)
  500.  
  501.   displayNameLen * = 32;
  502.  
  503. TYPE
  504.  
  505.   NameInfo * = RECORD (QueryHeader)
  506.     name *     : ARRAY displayNameLen OF CHAR;
  507.     reserved * : ARRAY 2 OF E.ULONG;          (* terminator *)
  508.   END; (* NameInfo *)
  509.  
  510. (*
  511. **      $VER: modeid.h 39.9 (27.5.93)
  512. **
  513. **      graphics display mode IDs.
  514. *)
  515.  
  516. CONST
  517.  
  518. (* DisplayInfoRecord identifiers *)
  519.  
  520.   invalidID *             = -1; (* ~0 *)
  521.  
  522. (* With all the new modes that are available under V38 and V39, it is highly
  523.  * recommended that you use either the asl.library screenmode requester,
  524.  * and/or the V39 graphics.library function BestModeIDA().
  525.  *
  526.  * DO NOT interpret the any of the bits in the ModeID for its meaning. For
  527.  * example, do not interpret bit 3 (0x4) as meaning the ModeID is interlaced.
  528.  * Instead, use GetDisplayInfoData() with dtagDisp, and examine the dip...
  529.  * flags to determine a ModeID's characteristics. The only exception to
  530.  * this rule is that bit 7 (0x80) will always mean the ModeID is
  531.  * ExtraHalfBright, and bit 11 (0x800) will always mean the ModeID is HAM.
  532.  *)
  533.  
  534. (* normal identifiers *)
  535.  
  536.   monitorIDMask *         = 0FFFF1000H;
  537.  
  538.   defaultMonitorID *      = 00000000H;
  539.   ntscMonitorID *         = 00011000H;
  540.   palMonitorID *          = 00021000H;
  541.  
  542. (* the following 22 composite keys are for Modes on the default Monitor.
  543.  * NTSC & PAL "flavors" of these particular keys may be made by or'ing
  544.  * the NTSC or PAL monitorId with the desired modeKey...
  545.  *
  546.  * For example, to specifically open a PAL HAM interlaced ViewPort
  547.  * (or intuition screen), you would use the modeid of
  548.  * (palMonitorId | hamlaceKey)
  549.  *)
  550.  
  551.   loresKey *                   = 00000000H;
  552.   hiresKey *                   = 00008000H;
  553.   superKey *                   = 00008020H;
  554.   hamKey *                     = 00000800H;
  555.   loresLaceKey *               = 00000004H;
  556.   hiresLaceKey *               = 00008004H;
  557.   superLaceKey *               = 00008024H;
  558.   hamLaceKey *                 = 00000804H;
  559.   loresDPFKey *                = 00000400H;
  560.   hiresDPFKey *                = 00008400H;
  561.   superDPFKey *                = 00008420H;
  562.   loresLaceDPFKey *            = 00000404H;
  563.   hiresLaceDPFKey *            = 00008404H;
  564.   superLaceDPFKey *            = 00008424H;
  565.   loresDPF2Key *               = 00000440H;
  566.   hiresDPF2Key *               = 00008440H;
  567.   superDPF2Key *               = 00008460H;
  568.   loresLaceDPF2Key *           = 00000444H;
  569.   hiresLaceDPF2Key *           = 00008444H;
  570.   superLaceDPF2Key *           = 00008464H;
  571.   extraHalfBriteKey *          = 00000080H;
  572.   extraHalfBriteLaceKey *      = 00000084H;
  573. (* New for AA ChipSet (V39) *)
  574.   hiresHAMKey *                = 00008800H;
  575.   superHAMKey *                = 00008820H;
  576.   hiresEHBKey *                = 00008080H;
  577.   superEHBKey *                = 000080A0H;
  578.   hiresHAMLaceKey *            = 00008804H;
  579.   superHAMLaceKey *            = 00008824H;
  580.   hiresEHBLaceKey *            = 00008084H;
  581.   superEHBLaceKey *            = 000080A4H;
  582. (* Added for V40 - may be useful modes for some games or animations. *)
  583.   loresSDblKey *               = 00000008H;
  584.   loresHAMSDblKey *            = 00000808H;
  585.   loresEHBSDblKey *            = 00000088H;
  586.   hiresHAMSDblKey *            = 00008808H;
  587.  
  588.  
  589. (* vga identifiers *)
  590.  
  591.   vgaMonitorID *               = 00031000H;
  592.  
  593.   vgaExtraLoresKey *           = 00031004H;
  594.   vgaLoresKey *                = 00039004H;
  595.   vgaProductKey *              = 00039024H;
  596.   vgaHAMKey *                  = 00031804H;
  597.   vgaExtraLoresLaceKey *       = 00031005H;
  598.   vgaLoresLaceKey *            = 00039005H;
  599.   vgaProductLaceKey *          = 00039025H;
  600.   vgaHAMLaceKey *              = 00031805H;
  601.   vgaExtraLoresDPFKey *        = 00031404H;
  602.   vgaLoresDPFKey *             = 00039404H;
  603.   vgaProductDPFKey *           = 00039424H;
  604.   vgaExtraLoresLaceDPFKey *    = 00031405H;
  605.   vgaLoresLaceDPFKey *         = 00039405H;
  606.   vgaProductLaceDPFKey *       = 00039425H;
  607.   vgaExtraLoresDPF2Key *       = 00031444H;
  608.   vgaLoresDPF2Key *            = 00039444H;
  609.   vgaProductDPF2Key *          = 00039464H;
  610.   vgaExtraLoresLaceDPF2Key *   = 00031445H;
  611.   vgaLoresLaceDPF2Key *        = 00039445H;
  612.   vgaProductLaceDPF2Key *      = 00039465H;
  613.   vgaExtraHalfBriteKey *       = 00031084H;
  614.   vgaExtraHalfBriteLaceKey *   = 00031085H;
  615. (* New for AA ChipSet (V39) *)
  616.   vgaProductHAMKey *           = 00039824H;
  617.   vgaLoresHAMKey *             = 00039804H;
  618.   vgaExtraLoresHAMKey *        = vgaHAMKey;
  619.   vgaProductHAMLaceKey *       = 00039825H;
  620.   vgaLoresHAMLaceKey *         = 00039805H;
  621.   vgaExtraLoresHAMLaceKey *    = vgaHAMLaceKey;
  622.   vgaExtraLoresEHBKey *        = vgaExtraHalfBriteKey;
  623.   vgaExtraLoresEHBLaceKey *    = vgaExtraHalfBriteLaceKey;
  624.   vgaLoresEHBKey *             = 00039084H;
  625.   vgaLoresEHBLaceKey *         = 00039085H;
  626.   vgaEHBKey *                  = 000390A4H;
  627.   vgaEHBLaceKey *              = 000390A5H;
  628. (* These ModeIDs are the scandoubled equivalents of the above, with the
  629.  * exception of the DualPlayfield modes, as AA does not allow for scandoubling
  630.  * dualplayfield.
  631.  *)
  632.   vgaExtraLoresDblKey *        = 00031000H;
  633.   vgaLoresDblKey *             = 00039000H;
  634.   vgaProductDblKey *           = 00039020H;
  635.   vgaExtraLoresHAMDblKey *     = 00031800H;
  636.   vgaLoresHAMDblKey *          = 00039800H;
  637.   vgaProductHAMDblKey *        = 00039820H;
  638.   vgaExtraLoresEHBDblKey *     = 00031080H;
  639.   vgaLoresEHBDblKey *          = 00039080H;
  640.   vgaProductEHBDblKey *        = 000390A0H;
  641.  
  642. (* a2024 identifiers *)
  643.  
  644.   a2024MonitorID *             = 00041000H;
  645.  
  646.   a2024tenHertzKey *           = 00041000H;
  647.   a2024fifteenHertzKey *       = 00049000H;
  648.  
  649. (* prototype identifiers *)
  650.  
  651.   protoMonitorID *             = 00051000H;
  652.  
  653. (* These monitors and modes were added for the V38 release. *)
  654.  
  655.   euro72MonitorId *            = 000061000H;
  656.  
  657.   euro72ExtraLoresKey *        = 000061004H;
  658.   euro72LoresKey *             = 000069004H;
  659.   euro72ProductKey *           = 000069024H;
  660.   euro72HAMKey *               = 000061804H;
  661.   euro72ExtraLoresLaceKey *    = 000061005H;
  662.   euro72LoresLaceKey *         = 000069005H;
  663.   euro72ProductLaceKey *       = 000069025H;
  664.   euro72HAMLaceKey *           = 000061805H;
  665.   euro72ExtraLoresDPFKey *     = 000061404H;
  666.   euro72LoresDPFKey *          = 000069404H;
  667.   euro72ProductDPFKey *        = 000069424H;
  668.   euro72ExtraLoresLaceDPFKey * = 000061405H;
  669.   euro72LoresLaceDPFKey *      = 000069405H;
  670.   euro72ProductLaceDPFKey *    = 000069425H;
  671.   euro72ExtraLoresDPF2Key *    = 000061444H;
  672.   euro72LoresDPF2Key *         = 000069444H;
  673.   euro72ProductDPF2Key *       = 000069464H;
  674.   euro72ExtraLoresLaceDPF2Key * = 000061445H;
  675.   euro72LoresLaceDPF2Key *     = 000069445H;
  676.   euro72ProductLaceDPF2Key *   = 000069465H;
  677.   euro72ExtraHalfBriteKey *    = 000061084H;
  678.   euro72ExtraHalfBriteLaceKey * = 000061085H;
  679. (* New AA modes (V39) *)
  680.   euro72ProductHAMKey *        = 000069824H;
  681.   euro72ProductHAMLaceKey *    = 000069825H;
  682.   euro72LoresHAMKey *          = 000069804H;
  683.   euro72LoresHAMLaceKey *      = 000069805H;
  684.   euro72ExtraLoresHAMKey *     = euro72HAMKey;
  685.   euro72ExtraLoresHAMLaceKey * = euro72HAMLaceKey;
  686.   euro72ExtraLoresEHBKey *     = euro72ExtraHalfBriteKey;
  687.   euro72ExtraLoresEHBLaceKey * = euro72ExtraHalfBriteLaceKey;
  688.   euro72LoresEHBKey *          = 000069084H;
  689.   euro72LoresEHBLaceKey *      = 000069085H;
  690.   euro72EHBKey *               = 0000690A4H;
  691.   euro72EHBLaceKey *           = 0000690A5H;
  692. (* These ModeIDs are the scandoubled equivalents of the above, with the
  693.  * exception of the DualPlayfield modes, as AA does not allow for scandoubling
  694.  * dualplayfield.
  695.  *)
  696.   euro72ExtraLoresDblKey *     = 000061000H;
  697.   euro72LoresDblKey *          = 000069000H;
  698.   euro72ProductDblKey *        = 000069020H;
  699.   euro72ExtraLoresHAMDblKey *  = 000061800H;
  700.   euro72LoresHAMDblKey *       = 000069800H;
  701.   euro72ProductHAMDblKey *     = 000069820H;
  702.   euro72ExtraLoresEHBDblKey *  = 000061080H;
  703.   euro72LoresEHBDblKey *       = 000069080H;
  704.   euro72ProductEHBDblKey *     = 0000690A0H;
  705.  
  706.  
  707.   euro36MonitorId *            = 000071000H;
  708.  
  709. (* Euro36 modeids can be ORed with the default modeids a la NTSC and PAL.
  710.  * For example, Euro36 SuperHires is
  711.  * (EURO36_MONITOR_ID | SUPER_KEY)
  712.  *)
  713.  
  714.   super72MonitorId *           = 000081000H;
  715.  
  716. (* Super72 modeids can be ORed with the default modeids a la NTSC and PAL.
  717.  * For example, Super72 SuperHiresLace (800x600) is
  718.  * (SUPER72_MONITOR_ID | SUPER_LACE_KEY).
  719.  * The following scandoubled Modes are the exception:
  720.  *)
  721.   super72LoresDblKey *         = 000081008H;
  722.   super72HiresDblKey *         = 000089008H;
  723.   super72SuperDblKey *         = 000089028H;
  724.   super72LoresHAMDblKey *      = 000081808H;
  725.   super72HiresHAMDblKey *      = 000089808H;
  726.   super72SuperHAMDblKey *      = 000089828H;
  727.   super72LoresEHBDblKey *      = 000081088H;
  728.   super72HiresEHBDblKey *      = 000089088H;
  729.   super72SuperEHBDblKey *      = 0000890A8H;
  730.  
  731.  
  732. (* These monitors and modes were added for the V39 release. *)
  733.  
  734.   dblNTSCMonitorId *           = 000091000H;
  735.  
  736.   dblNTSCLoresKey *            = 000091000H;
  737.   dblNTSCLoresffKey *          = 000091004H;
  738.   dblNTSCLoresHAMKey *         = 000091800H;
  739.   dblNTSCLoresHAMffKey *       = 000091804H;
  740.   dblNTSCLoresEHBKey *         = 000091080H;
  741.   dblNTSCLoresEHBffKey *       = 000091084H;
  742.   dblNTSCLoresLaceKey *        = 000091005H;
  743.   dblNTSCLoresHAMLaceKey *     = 000091805H;
  744.   dblNTSCLoresEHBLaceKey *     = 000091085H;
  745.   dblNTSCLoresDPFKey *         = 000091400H;
  746.   dblNTSCLoresDPFffKey *       = 000091404H;
  747.   dblNTSCLoresDPFLaceKey *     = 000091405H;
  748.   dblNTSCLoresDPF2Key *        = 000091440H;
  749.   dblNTSCLoresDPF2ffKey *      = 000091444H;
  750.   dblNTSCLoresDPF2LaceKey *    = 000091445H;
  751.   dblNTSCHiresKey *            = 000099000H;
  752.   dblNTSCHiresffKey *          = 000099004H;
  753.   dblNTSCHiresHAMKey *         = 000099800H;
  754.   dblNTSCHiresHAMffKey *       = 000099804H;
  755.   dblNTSCHiresLaceKey *        = 000099005H;
  756.   dblNTSCHiresHAMLaceKey *     = 000099805H;
  757.   dblNTSCHiresEHBKey *         = 000099080H;
  758.   dblNTSCHiresEHBffKey *       = 000099084H;
  759.   dblNTSCHiresEHBLaceKey *     = 000099085H;
  760.   dblNTSCHiresDPFKey *         = 000099400H;
  761.   dblNTSCHiresDPFffKey *       = 000099404H;
  762.   dblNTSCHiresDPFLaceKey *     = 000099405H;
  763.   dblNTSCHiresDPF2Key *        = 000099440H;
  764.   dblNTSCHiresDPF2ffKey *      = 000099444H;
  765.   dblNTSCHiresDPF2LaceKey *    = 000099445H;
  766.   dblNTSCExtraLoresKey *       = 000091200H;
  767.   dblNTSCExtraLoresHAMKey *    = 000091A00H;
  768.   dblNTSCExtraLoresEHBKey *    = 000091280H;
  769.   dblNTSCExtraLoresDPFKey *    = 000091600H;
  770.   dblNTSCExtraLoresDPF2Key *   = 000091640H;
  771.   dblNTSCExtraLoresffKey *     = 000091204H;
  772.   dblNTSCExtraLoresHAMffKey *  = 000091A04H;
  773.   dblNTSCExtraLoresEHBffKey *  = 000091284H;
  774.   dblNTSCExtraLoresDPFffKey *  = 000091604H;
  775.   dblNTSCExtraLoresDPF2ffKey * = 000091644H;
  776.   dblNTSCExtraLoresLaceKey *   = 000091205H;
  777.   dblNTSCExtraLoresHAMLaceKey * = 000091A05H;
  778.   dblNTSCExtraLoresEHBLaceKey * = 000091285H;
  779.   dblNTSCExtraLoresDPFLaceKey * = 000091605H;
  780.   dblNTSCExtraLoresDPF2LaceKey * = 000091645H;
  781.  
  782.   dblPALMonitorId *            = 0000A1000H;
  783.  
  784.   dblPALLoresKey *             = 0000A1000H;
  785.   dblPALLoresffKey *           = 0000A1004H;
  786.   dblPALLoresHAMKey *          = 0000A1800H;
  787.   dblPALLoresHAMffKey *        = 0000A1804H;
  788.   dblPALLoresEHBKey *          = 0000A1080H;
  789.   dblPALLoresEHBffKey *        = 0000A1084H;
  790.   dblPALLoresLaceKey *         = 0000A1005H;
  791.   dblPALLoresHAMLaceKey *      = 0000A1805H;
  792.   dblPALLoresEHBLaceKey *      = 0000A1085H;
  793.   dblPALLoresDPFKey *          = 0000A1400H;
  794.   dblPALLoresDPFffKey *        = 0000A1404H;
  795.   dblPALLoresDPFLaceKey *      = 0000A1405H;
  796.   dblPALLoresDPF2Key *         = 0000A1440H;
  797.   dblPALLoresDPF2ffKey *       = 0000A1444H;
  798.   dblPALLoresDPF2LaceKey *     = 0000A1445H;
  799.   dblPALHiresKey *             = 0000A9000H;
  800.   dblPALHiresffKey *           = 0000A9004H;
  801.   dblPALHiresHAMKey *          = 0000A9800H;
  802.   dblPALHiresHAMffKey *        = 0000A9804H;
  803.   dblPALHiresLaceKey *         = 0000A9005H;
  804.   dblPALHiresHAMLaceKey *      = 0000A9805H;
  805.   dblPALHiresEHBKey *          = 0000A9080H;
  806.   dblPALHiresEHBffKey *        = 0000A9084H;
  807.   dblPALHiresEHBLaceKey *      = 0000A9085H;
  808.   dblPALHiresDPFKey *          = 0000A9400H;
  809.   dblPALHiresDPFffKey *        = 0000A9404H;
  810.   dblPALHiresDPFLaceKey *      = 0000A9405H;
  811.   dblPALHiresDPF2Key *         = 0000A9440H;
  812.   dblPALHiresDPF2ffKey *       = 0000A9444H;
  813.   dblPALHiresDPF2LaceKey *     = 0000A9445H;
  814.   dblPALExtraLoresKey *        = 0000A1200H;
  815.   dblPALExtraLoresHAMKey *     = 0000A1A00H;
  816.   dblPALExtraLoresEHBKey *     = 0000A1280H;
  817.   dblPALExtraLoresDPFKey *     = 0000A1600H;
  818.   dblPALExtraLoresDPF2Key *    = 0000A1640H;
  819.   dblPALExtraLoresffKey *      = 0000A1204H;
  820.   dblPALExtraLoresHAMffKey *   = 0000A1A04H;
  821.   dblPALExtraLoresEHBffKey *   = 0000A1284H;
  822.   dblPALExtraLoresDPFffKey *   = 0000A1604H;
  823.   dblPALExtraLoresDPF2ffKey *  = 0000A1644H;
  824.   dblPALExtraLoresLaceKey *    = 0000A1205H;
  825.   dblPALExtraLoresHAMLaceKey * = 0000A1A05H;
  826.   dblPALExtraLoresEHBLaceKey * = 0000A1285H;
  827.   dblPALExtraLoresDPFLaceKey * = 0000A1605H;
  828.   dblPALExtraLoresDPF2LaceKey * = 0000A1645H;
  829.  
  830.  
  831. (* Use these tags for passing to BestModeID() (V39) *)
  832.  
  833.   specialFlags * = {dipIsDualPF, dipIsPF2Pri, dipIsHAM, dipIsExtraHalfBrite};
  834.  
  835.   bidTagDipMustHave *          = 080000001H;             (* mask of the DIPF_ flags the ModeID must have *)
  836.                                 (* Default - NULL *)
  837.   bidTagDipMustNotHave *       = 080000002H;             (* mask of the DIPF_ flags the ModeID must not have *)
  838.                                 (* Default - SPECIAL_FLAGS *)
  839.   bidTagViewPort *             = 080000003H;                  (* ViewPort for which a ModeID is sought. *)
  840.                                 (* Default - NULL *)
  841.   bidTagNominalWidth *         = 080000004H;              (*  together make the aspect ratio and *)
  842.   bidTagNominalHeight *        = 080000005H;             (* / override the vp->Width/Height. *)
  843.                                 (* Default - SourceID NominalDimensionInfo,
  844.                                  * or vp->DWidth/Height, or (640 * 200),
  845.                                  * in that preferred order.
  846.                                  *)
  847.   bidTagDesiredWidth *         = 080000006H;              (*  Nominal Width and Height of the *)
  848.   bidTagDesiredHeight *        = 080000007H;             (* / returned ModeID. *)
  849.                                 (* Default - same as Nominal *)
  850.   bidTagDepth *                = 080000008H;                    (* ModeID must support this depth. *)
  851.                                 (* Default - vp->RasInfo->BitMap->Depth or 1 *)
  852.   bidTagMonitorID *            = 080000009H;                  (* ModeID must use this monitor. *)
  853.                                 (* Default - use best monitor available *)
  854.   bidTagSourceID *             = 08000000AH;                   (* instead of a ViewPort. *)
  855.                                 (* Default - VPModeID(vp) if BID_TAG_ViewPort is
  856.                                  * specified, else leave the DIPFMustHave and
  857.                                  * DIPFMustNotHave values untouched.
  858.                                  *)
  859.   bidTagRedBits *              = 08000000BH;                   (*                             *)
  860.   bidTagBlueBits *             = 08000000CH;                  (* } Match up from the database *)
  861.   bidTagGreenBits *            = 08000000DH;                 (* /                            *)
  862.                                 (* Default - 4 *)
  863.   bidTagGfxPrivate *           = 08000000EH;                (* Private *)
  864.  
  865.  
  866. (*
  867. **      $VER: gels.h 39.0 (21.8.91)
  868. **
  869. **      definitions for AMIGA GELS (Graphics Elements)
  870. *)
  871.  
  872.  
  873. CONST
  874.  
  875. (* VSprite flags *)
  876. (* user-set VSprite flags: *)
  877.   sUserFlags *  = {0 .. 7};  (* mask of all user-settable VSprite-flags *)
  878.   vSprite *     = 0;         (* set if VSprite, clear if Bob *)
  879.   saveBack *    = 1;         (* set if background is to be saved/restored *)
  880.   overlay *     = 2;         (* set to mask image of Bob onto background *)
  881.   mustDraw *    = 3;         (* set if VSprite absolutely must be drawn *)
  882. (* system-set VSprite flags: *)
  883.   backSaved *   = 8;      (* this Bob's background has been saved *)
  884.   bobUpdate *   = 9;      (* temporary flag, useless to outside world *)
  885.   gelGone *     = 10;     (* set if gel is completely clipped (offscreen) *)
  886.   vsOverflow *  = 11;     (* VSprite overflow (if MUSTDRAW set we draw!) *)
  887.  
  888. (* Bob flags *)
  889. (* these are the user flag bits *)
  890.   bUserFlags *   = {0 .. 7}; (* mask of all user-settable Bob-flags *)
  891.   saveBob *      = 0;        (* set to not erase Bob *)
  892.   bobIsComp *    = 1;        (* set to identify Bob as AnimComp *)
  893. (* these are the system flag bits *)
  894.   bWaiting *     = 8;        (* set while Bob is waiting on 'after' *)
  895.   bDrawn *       = 9;        (* set when Bob is drawn this DrawG pass *)
  896.   bobsAway *     = 10;       (* set to initiate removal of Bob *)
  897.   bobNix *       = 11;       (* set when Bob is completely removed *)
  898.   savePreserve * = 12;       (* for back-restore during double-buffer *)
  899.   outStep *      = 13;       (* for double-clearing if double-buffer *)
  900.  
  901. (* defines for the animation procedures *)
  902.   anFracSize *  = 6;
  903.   animHalf *    = 0020H;
  904.   ringTrigger * = 0001H;
  905.  
  906.  
  907. TYPE
  908.  
  909. (* UserStuff definitions
  910.  *  the user can define these to be a single variable or a sub-structure
  911.  *  if undefined by the user, the system turns these into innocuous variables
  912.  *  see the manual for a thorough definition of the UserStuff definitions
  913.  *
  914. *)
  915.  
  916.   (* VSprite user stuff *)
  917.   VUserStuff * = INTEGER;
  918.  
  919.   (* Bob user stuff *)
  920.   BUserStuff * = INTEGER;
  921.  
  922.   (* AnimOb user stuff *)
  923.   AUserStuff * = INTEGER;
  924.  
  925.  
  926. (********************** * GEL STRUCTURES** ******************************** *)
  927.  
  928.   VSprite * = RECORD
  929. (* --------------------- SYSTEM VARIABLES ------------------------------- *)
  930. (* GEL linked list forward/backward pointers sorted by y,x value *)
  931.     nextVSprite * : VSpritePtr;
  932.     prevVSprite * : VSpritePtr;
  933.  
  934. (* GEL draw list constructed in the order the Bobs are actually drawn, then
  935.  *  list is copied to clear list
  936.  *  must be here in VSprite for system boundary detection
  937. *)
  938.     drawPath * : VSpritePtr;     (* pointer of overlay drawing *)
  939.     clearPath * : VSpritePtr;    (* pointer for overlay clearing *)
  940.  
  941. (* the VSprite positions are defined in (y,x) order to make sorting
  942.  *  sorting easier, since (y,x) as a long integer
  943. *)
  944.     oldY *, oldX * : INTEGER;          (* previous position *)
  945.  
  946. (* --------------------- COMMON VARIABLES --------------------------------- *)
  947.     flags * : E.WSET;        (* VSprite flags *)
  948.  
  949.  
  950. (* --------------------- USER VARIABLES ----------------------------------- *)
  951. (* the VSprite positions are defined in (y,x) order to make sorting
  952.  *  sorting easier, since (y,x) as a long integer
  953.  *)
  954.     y *, x * : INTEGER;                (* screen position *)
  955.  
  956.     height * : INTEGER;
  957.     width * : INTEGER;       (* number of words per row of image data *)
  958.     depth * : INTEGER;       (* number of planes of data *)
  959.  
  960.     meMask * : E.WSET;               (* which types can collide with this VSprite *)
  961.     hitMask * : E.WSET;              (* which types this VSprite can collide with *)
  962.  
  963.     imageData * : E.APTR;          (* pointer to VSprite image *)
  964.  
  965. (* borderLine is the one-dimensional logical OR of all
  966.  *  the VSprite bits, used for fast collision detection of edge
  967.  *)
  968.     borderLine * : E.APTR;         (* logical OR of all VSprite bits *)
  969.     collMask * : E.APTR;           (* similar to above except this is a matrix *)
  970.  
  971. (* pointer to this VSprite's color definitions (not used by Bobs) *)
  972.     sprColors * : E.APTR;
  973.  
  974.     vsBob * : BobPtr;        (* points home if this VSprite is part of
  975.                                    a Bob *)
  976.  
  977. (* planePick flag:  set bit selects a plane from image, clear bit selects
  978.  *  use of shadow mask for that plane
  979.  * OnOff flag: if using shadow mask to fill plane, this bit (corresponding
  980.  *  to bit in planePick) describes whether to fill with 0's or 1's
  981.  * There are two uses for these flags:
  982.  *      - if this is the VSprite of a Bob, these flags describe how the Bob
  983.  *        is to be drawn into memory
  984.  *      - if this is a simple VSprite and the user intends on setting the
  985.  *        MUSTDRAW flag of the VSprite, these flags must be set too to describe
  986.  *        which color registers the user wants for the image
  987.  *)
  988.     planePick * : E.BSET;
  989.     planeOnOff * : E.BSET;
  990.  
  991.     vUserExt * : VUserStuff;      (* user definable:  see note above *)
  992.   END; (* VSprite *)
  993.  
  994.  
  995.   Bob * = RECORD
  996. (* blitter-objects *)
  997. (* --------------------- SYSTEM VARIABLES --------------------------------- *)
  998.  
  999. (* --------------------- COMMON VARIABLES --------------------------------- *)
  1000.     flags * : E.WSET; (* general purpose flags (see definitions below) *)
  1001.  
  1002. (* --------------------- USER VARIABLES ----------------------------------- *)
  1003.     saveBuffer * : E.APTR;   (* pointer to the buffer for background save *)
  1004.  
  1005. (* used by Bobs for "cookie-cutting" and multi-plane masking *)
  1006.     imageShadow * : E.APTR;
  1007.  
  1008. (* pointer to BOBs for sequenced drawing of Bobs
  1009.  *  for correct overlaying of multiple component animations
  1010.  *)
  1011.     before * : BobPtr; (* draw this Bob before Bob pointed to by before *)
  1012.     after * : BobPtr;  (* draw this Bob after Bob pointed to by after *)
  1013.  
  1014.     bobVSprite * : VSpritePtr;   (* this Bob's VSprite definition *)
  1015.  
  1016.     bobComp * : AnimCompPtr;      (* pointer to this Bob's AnimComp def *)
  1017.  
  1018.     dBuffer * : DBufPacketPtr;     (* pointer to this Bob's dBuf packet *)
  1019.  
  1020.     bUserExt * : BUserStuff;            (* Bob user extension *)
  1021. END; (* Bob *)
  1022.  
  1023.   AnimComp * = RECORD
  1024. (* --------------------- SYSTEM VARIABLES --------------------------------- *)
  1025.  
  1026. (* --------------------- COMMON VARIABLES --------------------------------- *)
  1027.     flags * : E.WSET;             (* AnimComp flags for system & user *)
  1028.  
  1029. (* timer defines how long to keep this component active:
  1030.  *  if set non-zero, timer decrements to zero then switches to nextSeq
  1031.  *  if set to zero, AnimComp never switches
  1032.  *)
  1033.     timer * : INTEGER;
  1034.  
  1035. (* --------------------- USER VARIABLES ----------------------------------- *)
  1036. (* initial value for timer when the AnimComp is activated by the system *)
  1037.     timeSet * : INTEGER;
  1038.  
  1039. (* pointer to next and previous components of animation object *)
  1040.     nextComp * : AnimCompPtr;
  1041.     prevComp * : AnimCompPtr;
  1042.  
  1043. (* pointer to component component definition of next image in sequence *)
  1044.     nextSeq * : AnimCompPtr;
  1045.     prevSeq * : AnimCompPtr;
  1046.  
  1047.     animCRoutine * : E.PROC; (* address of special animation procedure *)
  1048.  
  1049.     yTrans * : INTEGER;     (* initial y translation (if this is a component) *)
  1050.     xTrans * : INTEGER;     (* initial x translation (if this is a component) *)
  1051.  
  1052.     headOb * : AnimObPtr;
  1053.  
  1054.     animBob * : BobPtr;
  1055.   END; (* AnimComp *)
  1056.  
  1057.  
  1058.   AnimOb * = RECORD
  1059. (* --------------------- SYSTEM VARIABLES --------------------------------- *)
  1060.     nextOb *, prevOb * : AnimObPtr;
  1061.  
  1062. (* number of calls to Animate this AnimOb has endured *)
  1063.     clock * : LONGINT;
  1064.  
  1065.     anOldY *, anOldX * : INTEGER;            (* old y,x coordinates *)
  1066.  
  1067. (* --------------------- COMMON VARIABLES --------------------------------- *)
  1068.     anY *, anX * : INTEGER;                  (* y,x coordinates of the AnimOb *)
  1069.  
  1070. (* --------------------- USER VARIABLES ----------------------------------- *)
  1071.     yVel *, xVel * : INTEGER;                (* velocities of this object *)
  1072.     yAccel *, xAccell * : INTEGER;            (* accelerations of this object *)
  1073.  
  1074.     ringYTrans *, ringXTrans * : INTEGER;    (* ring translation values *)
  1075.  
  1076.     animoRoutine * : E.PROC;         (* address of special animation
  1077.                                        procedure *)
  1078.  
  1079.     headComp * : AnimCompPtr;     (* pointer to first component *)
  1080.  
  1081.     aUserExt * : AUserStuff;            (* AnimOb user extension *)
  1082.   END; (* AnimOb *)
  1083.  
  1084.   DBufPacket * = RECORD
  1085.     bufY *, bufX * : INTEGER;                (* save the other buffers screen coordinates *)
  1086.     bufPath * : VSpritePtr;      (* carry the draw path over the gap *)
  1087.  
  1088. (* these pointers must be filled in by the user *)
  1089. (* pointer to other buffer's background save buffer *)
  1090.     bufBuffer * : E.APTR;
  1091.   END; (* DBufPacket *)
  1092.  
  1093.  
  1094.  
  1095. CONST
  1096.  
  1097. (*** ********************************************************************** *)
  1098.  
  1099. (* these are GEL functions that are currently simple enough to exist as a
  1100.  *  definition.  It should not be assumed that this will always be the case
  1101.  *)
  1102.  
  1103. (*
  1104. #define InitAnimate(animKey) {*(animKey) = NULL;}
  1105. #define RemBob(b) {(b)->Flags |= BOBSAWAY;}
  1106. *)
  1107.  
  1108. (*** ********************************************************************** *)
  1109.  
  1110.   b2Norm *      = 0;
  1111.   b2Swap *      = 1;
  1112.   b2Bobber *    = 2;
  1113.  
  1114. (*** ********************************************************************** *)
  1115.  
  1116. TYPE
  1117.  
  1118.   CollTable * = RECORD
  1119.     collPtrs * : ARRAY 16 OF E.APTR;
  1120.   END; (* CollTable *)
  1121.  
  1122.  
  1123. (*
  1124. **      $VER: collide.h 37.0 (7.1.91)
  1125. **
  1126. **      definitions for collision detection and control
  1127. *)
  1128.  
  1129.  
  1130. CONST
  1131.  
  1132. (* These bit descriptors are used by the GEL collide routines.
  1133.  *  These bits are set in the hitMask and meMask variables of
  1134.  *  a GEL to describe whether or not these types of collisions
  1135.  *  can affect the GEL.  bndryHIT is described further below;
  1136.  *  this bit is permanently assigned as the boundary-hit flag.
  1137.  *  The other bit gelHIT is meant only as a default to cover
  1138.  *  any GEL hitting any other; the user may redefine this bit.
  1139.  *)
  1140.   borderHit * = 0;
  1141.  
  1142. (* These bit descriptors are used by the GEL boundry hit routines.
  1143.  *  When the user's boundry-hit routine is called (via the argument
  1144.  *  set by a call to SetCollision) the first argument passed to
  1145.  *  the user's routine is the address of the GEL involved in the
  1146.  *  boundry-hit, and the second argument has the appropriate bit(s)
  1147.  *  set to describe which boundry was surpassed
  1148.  *)
  1149.   topHit *    = 1;
  1150.   bottomHit * = 2;
  1151.   leftHit *   = 4;
  1152.   rightHit *  = 8;
  1153.  
  1154.  
  1155. (*
  1156. **      $VER: rastport.h 39.0 (21.8.91)
  1157. **
  1158. **      Graphics library rastport definitions
  1159. *)
  1160.  
  1161.  
  1162. TYPE
  1163.  
  1164.   AreaInfo * = RECORD
  1165.     vctrTbl * : E.APTR;         (* ptr to start of vector table *)
  1166.     vctrPtr * : E.APTR;         (* ptr to current vertex *)
  1167.     flagTbl * : E.APTR;         (* ptr to start of vector flag table *)
  1168.     flagPtr * : E.APTR;         (* ptrs to areafill flags *)
  1169.     count   * : INTEGER;        (* number of vertices in list *)
  1170.     maxCount * : INTEGER;         (* AreaMove/Draw will not allow Count>MaxCount *)
  1171.     firstX *, firstY * : INTEGER;    (* first point for this polygon *)
  1172.   END; (* AreaInfo *)
  1173.  
  1174.   TmpRas * = RECORD
  1175.     rasPtr * : E.APTR;
  1176.     size * : LONGINT;
  1177.   END; (* TmpRas *)
  1178.  
  1179.   GelsInfo * = RECORD
  1180.     sprRsrvd * : SHORTINT;            (* flag of which sprites to reserve from
  1181.                                  vsprite system *)
  1182.     flags * : E.BSET;              (* system use *)
  1183.     gelHead *, gelTail * : VSpritePtr; (* dummy vSprites for list management *)
  1184.     (* pointer to array of 8 INTEGERS for sprite available lines *)
  1185.     nextLine * : CPOINTER TO ARRAY 8 OF INTEGER;
  1186.     (* pointer to array of 8 pointers for color-last-assigned to vSprites *)
  1187.     lastColor * : CPOINTER TO ARRAY 8 OF CPOINTER TO INTEGER;
  1188.     collHandler * : CollTablePtr;     (* addresses of collision routines *)
  1189.     leftmost *, rightmost *, topmost *, bottommost * : INTEGER;
  1190.     firstBlissObj *, lastBlissObj * : E.APTR;    (* system use only *)
  1191.   END; (* GelsInfo *)
  1192.  
  1193.   RastPort * = RECORD
  1194.     layer *        : LayerPtr;
  1195.     bitMap *       : BitMapPtr;
  1196.     areaPtrn *     : E.APTR;        (* ptr to areafill pattern *)
  1197.     tmpRas *       : TmpRasPtr;
  1198.     areaInfo *     : AreaInfoPtr;
  1199.     gelsInfo *     : GelsInfoPtr;
  1200.     mask *         : E.BSET;        (* write mask for this raster *)
  1201.     fgPen *        : SHORTINT;      (* foreground pen for this raster *)
  1202.     bgPen *        : SHORTINT;      (* background pen  *)
  1203.     aOlPen *       : SHORTINT;      (* areafill outline pen *)
  1204.     drawMode *     : E.BSET;        (* drawing mode for fill, lines, and text *)
  1205.     areaPtSz *     : SHORTINT;      (* 2^n words for areafill pattern *)
  1206.     linpatcnt *    : SHORTINT;      (* current line drawing pattern preshift *)
  1207.     dummy *        : SHORTINT;
  1208.     flags *        : E.WSET;        (* miscellaneous control bits *)
  1209.     linePtrn *     : E.UWORD;       (* 16 bits for textured lines *)
  1210.     x *, y *       : INTEGER;       (* current pen position *)
  1211.     minterms *     : ARRAY 8 OF E.UBYTE;
  1212.     penWidth *     : INTEGER;
  1213.     penHeight *    : INTEGER;
  1214.     font *         : TextFontPtr;   (* current font address *)
  1215.     algoStyle *    : E.BSET;        (* the algorithmically generated style *)
  1216.     txFlags *      : E.BSET;          (* text specific flags *)
  1217.     txHeight *     : E.UWORD;         (* text height *)
  1218.     txWidth *      : E.UWORD;          (* text nominal width *)
  1219.     txBaseline *   : E.UWORD;       (* text baseline *)
  1220.     txSpacing *    : INTEGER;        (* text spacing (per character) *)
  1221.     user *         : E.APTR;
  1222.     longreserved * : ARRAY 2 OF E.ULONG;
  1223.     wordreserved * : ARRAY 7 OF E.UWORD;  (* used to be a node *)
  1224.     reserved *     : ARRAY 8 OF E.UBYTE;      (* for future use *)
  1225.   END; (* RastPort *)
  1226.  
  1227. CONST
  1228.  
  1229. (* drawing modes *)
  1230.   jam1 *        = {};         (* jam 1 color into raster *)
  1231.   jam2 *        = {0};         (* jam 2 colors into raster *)
  1232.   complement *  = 1;         (* XOR bits into raster *)
  1233.   inversVid *   = 2;         (* inverse video for drawing modes *)
  1234.  
  1235. (* these are the flag bits for RastPort flags *)
  1236.   frstDot *    = 0;      (* draw the first dot of this line ? *)
  1237.   oneDot *     = 1;      (* use one dot mode for drawing lines *)
  1238.   dBuffer *    = 2;      (* flag set when RastPorts
  1239.                             are double-buffered *)
  1240.  
  1241.              (* only used for bobs *)
  1242.  
  1243.   areaOutline * = 3;      (* used by areafiller *)
  1244.   noCrossFill * = 5;      (* areafills have no crossovers *)
  1245.  
  1246. (* there is only one style of clipping: raster clipping *)
  1247. (* this preserves the continuity of jaggies regardless of clip window *)
  1248. (* When drawing into a RastPort, if the ptr to ClipRect is nil then there *)
  1249. (* is no clipping done, this is dangerous but useful for speed *)
  1250.  
  1251. (*
  1252. **      $VER: copper.h 39.10 (31.5.93)
  1253. **
  1254. **      graphics copper list intstruction definintions
  1255. *)
  1256.  
  1257.  
  1258. CONST
  1259.  
  1260.   copperMove *  = 0;   (* pseude opcode for move #XXXX,dir *)
  1261.   copperWait *  = 1;   (* pseudo opcode for wait y,x *)
  1262.   cprNxtBuf *  = 2;   (* continue processing with next buffer *)
  1263.   cprNtLof * = 15;  (* copper instruction only for short frames *)
  1264.   cprNtSht * = 14;  (* copper instruction only for long frames *)
  1265.   cprNtSys * = 13;  (* copper user instruction only *)
  1266.  
  1267. TYPE
  1268.  
  1269.   CopIns * = RECORD
  1270.     opCode * : INTEGER; (* 0 = move, 1 = wait *)
  1271.     destAddr *: INTEGER; (* vertical beam wait OR
  1272.                           * destination address of copper move *)
  1273.     destData *: INTEGER; (* beam wait position OR
  1274.                           * destination immediate data to send *)
  1275.   END; (* CopIns *)
  1276.  
  1277.   CopInsCL * = RECORD
  1278.     opCode * : INTEGER;
  1279.     nxtlist * : CopListBasePtr;
  1280.   END; (* CopInsCL *)
  1281.  
  1282. TYPE
  1283.  
  1284.   Cprlist * = RECORD
  1285.     next *     : CprlistPtr;
  1286.     start *    : E.APTR;         (* start of copper list *)
  1287.     maxCount * : INTEGER;        (* number of long instructions *)
  1288.   END; (* Cprlist *)
  1289.  
  1290.   CopListBase * = RECORD
  1291.     next *      : CopListBasePtr; (* next block for this copper list *)
  1292.     copList *   : CopListBasePtr; (* system use *)
  1293.     viewPort *  : ViewPortPtr;    (* system use *)
  1294.     copIns *    : CopInsPtr;      (* start of this block *)
  1295.     copPtr *    : CopInsPtr;      (* intermediate ptr *)
  1296.     copLStart * : E.APTR;         (* mrgcop fills this in for Long Frame *)
  1297.     copSStart * : E.APTR;         (* mrgcop fills this in for Short Frame *)
  1298.     count *     : INTEGER;        (* intermediate counter *)
  1299.     maxCount *  : INTEGER;        (* max # of copins for this block *)
  1300.     dyOffset *  : INTEGER;        (* offset this copper list vertical waits *)
  1301.   END;
  1302.  
  1303.   CopList * = RECORD (CopListBase)
  1304.     slRepeat *  : INTEGER;
  1305.     flags *     : E.WSET;
  1306.   END; (* CopList *)
  1307.  
  1308.   CopList13 = RECORD (CopListBase)
  1309.     cop2Start * : E.APTR;
  1310.     cop3Start * : E.APTR;
  1311.     cop4Start * : E.APTR;
  1312.     cop5Start * : E.APTR;
  1313.     slRepeat  * : INTEGER;
  1314.     flags     * : E.WSET;
  1315.   END; (* CopList13 *)
  1316.  
  1317.   UCopList * = RECORD
  1318.     next *         : UCopListPtr;
  1319.     firstCopList * : CopListBasePtr; (* head node of this copper list *)
  1320.     copList *      : CopListBasePtr; (* node in use *)
  1321.   END; (* UCopList *)
  1322.  
  1323. (* private graphics data structure *)
  1324.  
  1325.   CopinitPtr = CPOINTER TO Copinit;
  1326.   Copinit = RECORD
  1327.     vsyncHblank : ARRAY 2 OF E.UWORD;
  1328.     diagstrt    : ARRAY 12 OF E.UWORD; (* copper list for first bitplane *)
  1329.     fm0         : ARRAY 2 OF E.UWORD;
  1330.     diwstart    : ARRAY 10 OF E.UWORD;
  1331.     bplcon2     : ARRAY 2 OF E.UWORD;
  1332.     sprfix      : ARRAY 2*8 OF E.UWORD;
  1333.     sprstrtup   : ARRAY (2*8*2) OF E.UWORD;
  1334.     wait14      : ARRAY 2 OF E.UWORD;
  1335.     normHblank  : ARRAY 2 OF E.UWORD;
  1336.     jump        : ARRAY 2 OF E.UWORD;
  1337.     waitForever : ARRAY 6 OF E.UWORD;
  1338.     sprstop     : ARRAY 8 OF E.UWORD;
  1339.   END; (* Copinit *)
  1340.  
  1341.  
  1342. (*
  1343. **      $VER: view.h 39.34 (31.5.93)
  1344. **
  1345. **      graphics view/viewport definintions
  1346. *)
  1347.  
  1348. TYPE
  1349.  
  1350.   ViewPort * = RECORD
  1351.     next *             : ViewPortPtr;
  1352.     colorMap *         : ColorMapPtr;     (* table of colors for this viewport *)
  1353.                                           (* if this is nil, MakeVPort assumes default values *)
  1354.     dspIns *           : CopListBasePtr; (* user by MakeView() *)
  1355.     sprIns *           : CopListBasePtr; (* used by sprite stuff *)
  1356.     clrIns *           : CopListBasePtr; (* used by sprite stuff *)
  1357.     uCopIns *          : UCopListPtr;     (* User copper list *)
  1358.     dWidth *, dHeight * : INTEGER;
  1359.     dxOffset *, dyOffset * : INTEGER;
  1360.     modes *            : E.WSET;
  1361.     spritePriorities * : E.UBYTE;         (* used by makevp *)
  1362.     extendedModes *    : E.UBYTE;
  1363.     rasInfo *          : RasInfoPtr;
  1364.   END; (* ViewPort *)
  1365.  
  1366.   View * = RECORD
  1367.     viewPort *   : ViewPortPtr;
  1368.     lofCprList * : CprlistPtr;        (* used for interlaced and noninterlaced *)
  1369.     shfCprList * : CprlistPtr;        (* only used during interlace *)
  1370.     dyOffset *, dxOffset * : INTEGER; (* for complete View positioning *)
  1371.                                       (* offsets are +- adjustments to standard #s *)
  1372.     modes *      : E.WSET;            (* such as INTERLACE, GENLOC *)
  1373.   END; (* View *)
  1374.  
  1375. (* these structures are obtained via GfxNew *)
  1376. (* and disposed by GfxFree *)
  1377.   ViewExtra * = RECORD (ExtendedNode)
  1378.     view *    : ViewPtr;        (* backwards link *)
  1379.     monitor * : MonitorSpecPtr; (* monitors for this view *)
  1380.     topLine * :  E.UWORD;
  1381.   END; (* ViewExtra *)
  1382.  
  1383. (* this structure is obtained via GfxNew *)
  1384. (* and disposed by GfxFree *)
  1385.   ViewPortExtra * = RECORD (ExtendedNode)
  1386.     viewPort *    : ViewPortPtr;        (* backwards link *)
  1387.     displayClip * : Rectangle;          (* makevp display clipping information *)
  1388.     (* These are added for V39 *)
  1389.     vecTable      : E.APTR;             (* Private *)
  1390.     driverData *  : ARRAY 2 OF E.APTR;
  1391.     flags *       : E.WSET;
  1392.     origin *      : ARRAY 2 OF Point;   (* First visible point relative to the DClip.
  1393.                                          * One for each possible playfield.
  1394.                                          *)
  1395.     cop1ptr       : E.ULONG;            (* private *)
  1396.     cop2ptr       : E.ULONG;            (* private *)
  1397.   END; (* ViewPortExtra *)
  1398.  
  1399. CONST
  1400.  
  1401. (* All these vpx flags are private *)
  1402.   vpxFreeMe       = 0;
  1403.   vpxLast         = 1;
  1404.   vpxStraddles256 = 4;
  1405.   vpxStraddles512 = 5;
  1406.  
  1407.   extendVStruct *  = 12;  (* unused bit in Modes field of View *)
  1408.  
  1409. (* VP_ fields internal only *)
  1410.   vpA2024 = 6;
  1411.   vpTenhz = 4;
  1412.  
  1413. (* defines used for Modes in IVPargs *)
  1414.  
  1415.   genLockVideo *   = 1;
  1416.   lace *           = 2;
  1417.   doubleScan *     = 3;
  1418.   superHires *     = 5;
  1419.   pfba *           = 6;
  1420.   extraHalfBrite * = 7;
  1421.   genlockAudio *   = 8;
  1422.   dualpf *         = 10;
  1423.   ham *            = 11;
  1424.   extendedMode *   = 12;
  1425.   vpHide *         = 13;
  1426.   sprites *        = 14;
  1427.   hires *          = 15;
  1428.  
  1429. TYPE
  1430.  
  1431. (* used by callers to and InitDspC() *)
  1432.  
  1433.   RasInfo * = RECORD
  1434.     next *   : RasInfoPtr;          (* used for dualpf *)
  1435.     bitMap * : BitMapPtr;
  1436.     rxOffset *, ryOffset : INTEGER; (* scroll offsets in this BitMap *)
  1437.   END; (* RasInfo *)
  1438.  
  1439.   ColorMap * = RECORD
  1440.     flags *             : E.BSET;
  1441.     type *              : E.UBYTE;
  1442.     count *             : E.UWORD;
  1443.     colorTable *        : E.APTR;
  1444.     vpe *               : ViewPortExtraPtr;
  1445.     lowColorBits *      : E.APTR;
  1446.     transparencyPlane * : E.UBYTE;
  1447.     spriteResolution *  : E.UBYTE;
  1448.     spriteResDefault *  : E.UBYTE;      (* what resolution you get when you have set SPRITERESN_DEFAULT *)
  1449.     auxFlags *          : E.BSET;
  1450.     vp *                : ViewPortPtr;
  1451.     normalDisplayInfo * : DisplayInfoPtr;
  1452.     coerceDisplayInfo * : DisplayInfoPtr;
  1453.     cmBatchItems *      : U.TagListPtr;
  1454.     vpModeID *          : E.ULONG;
  1455.     palExtra *          : PaletteExtraPtr;
  1456.     spriteBaseEven *    : E.UWORD;
  1457.     spriteBaseOdd *     : E.UWORD;
  1458.     bp0base *           : E.UWORD;
  1459.     bp1base *           : E.UWORD;
  1460.   END; (* ColorMap *)
  1461.  
  1462. CONST
  1463.  
  1464. (* if Type == 0 then ColorMap is V1.2/V1.3 compatible *)
  1465. (* if Type != 0 then ColorMap is V38       compatible *)
  1466. (* the system will never create other than V39 type colormaps when running V39 *)
  1467.  
  1468.   colorMapTypeV12 *      = 0;
  1469.   colorMapTypeV14 *      = 1;
  1470.   colorMapTypeV36 *      = colorMapTypeV14;    (* use this definition *)
  1471.   colorMapTypeV39 *      = 2;
  1472.  
  1473. (* Flags variable *)
  1474.   colorMapTransparency *   = 0;
  1475.   colorPlaneTransparency * = 1;
  1476.   borderBlanking *         = 2;
  1477.   borderNoTransparency *   = 3;
  1478.   videoControlBatch *      = 4;
  1479.   userCopperClip *         = 5;
  1480.   borderSprites *          = 6;
  1481.  
  1482.   cmfCmTrans * = 0;
  1483.   cmfCpTrans * = 1;
  1484.   cmfBrdrBlnk * = 2;
  1485.   cmfBrdnTran * = 3;
  1486.   cmfBrdrSprt * = 6;
  1487.  
  1488.   spriteResnEcs * = 0;
  1489. (* ^140ns, except in 35ns viewport, where it is 70ns. *)
  1490.   spriteResn140ns * = 1;
  1491.   spriteResn70ns * = 2;
  1492.   spriteResn35ns * = 3;
  1493.   spriteResnDefault * = -1;
  1494.  
  1495. (* AuxFlags : *)
  1496.   cmaFullPalette * = 0;
  1497.   cmaNoIntermedUpdate * = 1;
  1498.   cmaNoColorLoad * = 2;
  1499.   cmaDualPFDisable * = 3;
  1500.  
  1501. TYPE
  1502.  
  1503.   (* structure may be extended so watch out! *)
  1504.   PaletteExtra * = RECORD (E.SignalSemaphore) (* shared semaphore for arbitration     *)
  1505.     firstFree        :  E.UWORD;              (* *private*                            *)
  1506.     nFree *          :  E.UWORD;              (* number of free colors                *)
  1507.     firstShared      :  E.UWORD;              (* *private*                            *)
  1508.     nShared          :  E.UWORD;              (* *private*                            *)
  1509.     refCnt           :  E.APTR;               (* *private*                            *)
  1510.     allocList        :  E.APTR;               (* *private*                            *)
  1511.     viewPort *       :  ViewPortPtr;          (* back pointer to viewport             *)
  1512.     sharableColors * :  E.UWORD;              (* the number of sharable colors.       *)
  1513.   END;
  1514.  
  1515. CONST
  1516.  
  1517. (* flags values for ObtainPen *)
  1518.  
  1519.   penExclusive * = 0;
  1520.   penNoSetColor * = 1;
  1521.  
  1522. (* precision values for ObtainBestPen : *)
  1523.  
  1524.   precisionExact * = -1;
  1525.   precisionImage * = 0;
  1526.   precisionIcon * = 16;
  1527.   precisionGui * = 32;
  1528.  
  1529.  
  1530. (* tags for ObtainBestPen: *)
  1531.   obpPrecision * = 084000000H;
  1532.   obpFailIfBad * = 084000001H;
  1533.  
  1534. (* From V39, MakeVPort() will return an error if there is not enough memory,
  1535.  * or the requested mode cannot be opened with the requested depth with the
  1536.  * given bitmap (for higher bandwidth alignments).
  1537.  *)
  1538.  
  1539.   mvpOk * = 0;                  (* you want to see this one *)
  1540.   mvpNoMem * = 1;               (* insufficient memory for intermediate workspace *)
  1541.   mvpNoVpe * = 2;               (* ViewPort does not have a ViewPortExtra, and
  1542.                                  * insufficient memory to allocate a temporary one.
  1543.                                  *)
  1544.   mvpNoDspins * = 3;            (* insufficient memory for intermidiate copper
  1545.                                  * instructions.
  1546.                                  *)
  1547.   mvpNoDisplay * = 4;           (* BitMap data is misaligned for this viewport's
  1548.                                  * mode and depth - see AllocBitMap().
  1549.                                  *)
  1550.   mvpOffBottom = 5;             (* PRIVATE - you will never see this. *)
  1551.  
  1552. (* From V39, MrgCop() will return an error if there is not enough memory,
  1553.  * or for some reason MrgCop() did not need to make any copper lists.
  1554.  *)
  1555.  
  1556.   mcopOk * = 0;                 (* you want to see this one *)
  1557.   mcopNoMem * = 1;              (* insufficient memory to allocate the system
  1558.                                  * copper lists.
  1559.                                  *)
  1560.   mcopNop * = 2;                (* MrgCop() did not merge any copper lists
  1561.                                  * (eg, no ViewPorts in the list, or all marked as
  1562.                                  * hidden).
  1563.                                  *)
  1564.  
  1565. TYPE
  1566.  
  1567.   DBufInfo  * = RECORD
  1568.     link1 *       : E.APTR;
  1569.     count1 *      : E.ULONG;
  1570.     safeMessage * : E.Message;  (* replied to when safe to write to old bitmap *)
  1571.     userData1 *   : E.APTR;     (* first user data *)
  1572.  
  1573.     link2 *       : E.APTR;
  1574.     count2 *      : E.ULONG;
  1575.     dispMessage * : E.Message;  (* replied to when new bitmap has been displayed at least
  1576.                                    once *)
  1577.     userData2 *   : E.APTR;     (* second user data *)
  1578.     matchLong *   : E.ULONG;
  1579.     copPtr1 *     : E.APTR;
  1580.     copPtr2 *     : E.APTR;
  1581.     copPtr3 *     : E.APTR;
  1582.     beamPos1 *    : E.UWORD;
  1583.     beamPos2 *    : E.UWORD;
  1584.   END;
  1585.  
  1586.  
  1587. (*
  1588. **      $VER: layers.h 39.4 (14.4.92)
  1589. **
  1590. **      graphics library layers definitions
  1591. *)
  1592.  
  1593.  
  1594. CONST
  1595.  
  1596.   layerSimple *           = 0;
  1597.   layerSmart *            = 1;
  1598.   layerSuper *            = 2;
  1599.   layerUpdating *         = 4;
  1600.   layerBackdrop *         = 6;
  1601.   layerRefresh *          = 7;
  1602.   layerIRefresh *         = 9;
  1603.   layerIRefresh2 *        = 10;
  1604.   layerClipRectsLost *    = 8;   (* during BeginUpdate *)
  1605.                                  (* or during layerop *)
  1606.                                  (* this happens if out of memory *)
  1607.  
  1608. TYPE
  1609.  
  1610.   LayerInfo * = RECORD
  1611.     topLayer *      : LayerPtr;
  1612.     checklp         : LayerPtr;           (* !! Private !! *)
  1613.     obs *           : ClipRectPtr;
  1614.     freeClipRects   : ClipRectPtr;        (* !! Private !! *)
  1615.     privateReserve1 : LONGINT;            (* !! Private !! *)
  1616.     privateReserve2 : LONGINT;            (* !! Private !! *)
  1617.     lock            : E.SignalSemaphore;  (* !! Private !! *)
  1618.     gsHead          : E.MinList;          (* !! Private !! *)
  1619.     privateReserve3 : INTEGER;            (* !! Private !! *)
  1620.     privateReserve4 : E.APTR;             (* !! Private !! *)
  1621.     flags *         : E.WSET;
  1622.     fattenCount     : SHORTINT;           (* !! Private !! *)
  1623.     lockLayersCount : SHORTINT;           (* !! Private !! *)
  1624.     privateReserve5 : INTEGER;            (* !! Private !! *)
  1625.     blankHook       : E.APTR;             (* !! Private !! *)
  1626.     layerInfoExtra  : E.APTR;             (* !! Private !! *)
  1627.   END; (* LayerInfo *)
  1628.  
  1629. CONST
  1630.  
  1631.   newLayerInfoCalled * = 1;
  1632.  
  1633. (*
  1634.  * layersNoBackfill is the value needed to get no backfill hook
  1635.  * layersBackfill is the value needed to get the default backfill hook
  1636.  *)
  1637.   layersNoBackfill * = SYS.VAL (U.HookPtr, 1);
  1638.   layersBackfill   * = NIL;
  1639.  
  1640.  
  1641. (*
  1642. **      $VER: clip.h 39.0 (2.12.91)
  1643. **
  1644. **      Graphics library clip definitions
  1645. *)
  1646.  
  1647.  
  1648. TYPE
  1649.  
  1650.   Layer * = RECORD
  1651.     front *, back *      : LayerPtr;
  1652.     clipRect *           : ClipRectPtr;  (* read by roms to find first cliprect *)
  1653.     rp *                 : RastPortPtr;
  1654.     bounds *             : Rectangle;
  1655.     reserved *           : ARRAY 4 OF E.UBYTE;
  1656.     priority *           : E.UWORD;   (* system use only *)
  1657.     flags *              : E.WSET; (* obscured ?, Virtual BitMap? *)
  1658.     superBitMap *        : BitMapPtr;
  1659.     superClipRect *      : ClipRectPtr;  (* super bitmap cliprects if VBitMap != 0 *)
  1660.                                          (* else damage cliprect list for refresh *)
  1661.     window *             : E.APTR;    (* reserved for user interface use *)
  1662.     scrollX *, scrollY * : INTEGER;
  1663.     cr *, cr2 *, crnew * : ClipRectPtr;  (* used by dedice *)
  1664.     superSaveClipRects * : ClipRectPtr;  (* preallocated cr's *)
  1665.     cliprects *          : ClipRectPtr;  (* system use during refresh *)
  1666.     layerInfo *          : LayerInfoPtr; (* points to head of the list *)
  1667.     lock *               : E.SignalSemaphore;
  1668.     backFill *           : U.HookPtr;
  1669.     reserved1 *          : E.ULONG;
  1670.     clipRegion *         : RegionPtr;
  1671.     saveClipRects *      : RegionPtr;    (* used to back out when in trouble *)
  1672.     width *, height *    : INTEGER;      (* system use *)
  1673.     reserved2 *          : ARRAY 18 OF E.UBYTE;
  1674.     (* this must stay here *)
  1675.     damageList *         : RegionPtr;    (* list of rectangles to refresh
  1676.                                             through *)
  1677.   END; (* Layer *)
  1678.  
  1679.   ClipRect * = RECORD
  1680.     next *     : ClipRectPtr;  (* roms used to find next ClipRect *)
  1681.     prev       : ClipRectPtr;  (* Temp use in layers (private) *)
  1682.     lobs       : LayerPtr;     (* Private use for layers *)
  1683.     bitMap     : BitMapPtr;    (* Bitmap for layers private use *)
  1684.     bounds *   : Rectangle;    (* bounds of cliprect *)
  1685.     p1         : E.APTR;       (* Layers private use!!! *)
  1686.     p2         : E.APTR;       (* Layers private use!!! *)
  1687.     reserved   : LONGINT;      (* system use (Layers private) *)
  1688.     flags      : SET;          (* Layers private field for cliprects *)
  1689.                                (* that layers allocates... *)
  1690.                                (* MUST be multiple of 8 bytes to buffer *)
  1691.   END; (* ClipRect *)
  1692.  
  1693. CONST
  1694.  
  1695. (* internal cliprect flags *)
  1696.   crNeedsNoConcealedRasters = 1;
  1697.   crNeedsNoLayerblitDamage  = 2;
  1698.  
  1699. (* defines for code values for getcode *)
  1700.   isLessX * = 1;
  1701.   isLessY * = 2;
  1702.   isGrtrX * = 4;
  1703.   isGrtrY * = 8;
  1704.  
  1705.  
  1706. (*
  1707. **      $VER: regions.h 39.0 (21.8.91)
  1708. **
  1709. **      Graphics region definitions
  1710. *)
  1711.  
  1712.  
  1713. TYPE
  1714.  
  1715.   RegionRectangle * = RECORD
  1716.     next *, prev * : RegionRectanglePtr;
  1717.     bounds *       : Rectangle;
  1718.   END; (* RegionRectangle *)
  1719.  
  1720.   Region * = RECORD (Rectangle)
  1721.     regionRectangle * : RegionRectanglePtr;
  1722.   END; (* Region *)
  1723.  
  1724.  
  1725. (*
  1726. **      $VER: sprite.h 39.6 (16.6.92)
  1727. **
  1728. **      Graphics sprite definitions
  1729. *)
  1730.  
  1731. CONST
  1732.  
  1733.   spriteAttached * = 80H;
  1734.  
  1735. TYPE
  1736.  
  1737.   SimpleSprite * = RECORD
  1738.     posctldata * : E.APTR;
  1739.     height *     : E.UWORD;
  1740.     x *, y *     : E.UWORD;    (* current position *)
  1741.     num *        : E.UWORD;
  1742.   END; (* SimpleSprite *)
  1743.  
  1744.   ExtSprite * = RECORD (SimpleSprite) (* conventional simple sprite structure *)
  1745.     wordWidth *    : E.UWORD;         (* graphics use only, subject to change *)
  1746.     flags *        : E.UWORD;         (* graphics use only, subject to change *)
  1747.   END;
  1748.  
  1749. CONST
  1750.  
  1751. (* tags for AllocSpriteData() *)
  1752.   spriteaWidth *         = 081000000H;
  1753.   spriteaXReplication *  = 081000002H;
  1754.   spriteaYReplication *  = 081000004H;
  1755.   spriteaOutputHeight *  = 081000006H;
  1756.   spriteaAttached *      = 081000008H;
  1757.   spriteaOldDataFormat * = 08100000AH; (* MUST pass in outputheight if using this tag *)
  1758.  
  1759. (* tags for GetExtSprite() *)
  1760.   gstagSpriteNum *       = 082000020H;
  1761.   gstagAttached *        = 082000022H;
  1762.   gstagSoftSprite *      = 082000024H;
  1763.  
  1764. (* tags valid for either GetExtSprite or ChangeExtSprite *)
  1765.   gstagScanDoubled *     = 083000000H; (* request "NTSC-Like" height if possible. *)
  1766.  
  1767.  
  1768. (*
  1769. **      $VER: text.h 39.0 (21.8.91)
  1770. **
  1771. **      graphics library text structures
  1772. *)
  1773.  
  1774.  
  1775. CONST
  1776.  
  1777. (* ------ Font Styles ------------------------------------------------ *)
  1778.   fsNormal *      = {};      (* normal text (no style bits set) *)
  1779.   fsUnderlined *  = 0;       (* underlined (under baseline) *)
  1780.   fsBold *        = 1;       (* bold face text (ORed w/ shifted) *)
  1781.   fsItalic *      = 2;       (* italic (slanted 1:2 right) *)
  1782.   fsExtended *    = 3;       (* extended face (wider than normal) *)
  1783.  
  1784.   fsColorfont *   = 6;       (* this uses ColorTextFont structure *)
  1785.   fsTagged *      = 7;       (* the TextAttr is really an TTextAttr, *)
  1786.  
  1787. (* ------ Font Flags ------------------------------------------------- *)
  1788.   fpRomFont *      = 0;     (* font is in rom *)
  1789.   fpDiskFont *     = 1;     (* font is from diskfont.library *)
  1790.   fpRevPath *      = 2;     (* designed path is reversed (e.g. left) *)
  1791.   fpTallDot *      = 3;     (* designed for hires non-interlaced *)
  1792.   fpWideDot *      = 4;     (* designed for lores interlaced *)
  1793.   fpProportional * = 5;     (* character sizes can vary from nominal *)
  1794.   fpDesigned *     = 6;     (* size explicitly designed, not constructed *)
  1795.                             (* note: if you do not set this bit in your *)
  1796.                             (* textattr, then a font may be constructed *)
  1797.                             (* for you by scaling an existing rom or disk *)
  1798.                             (* font (under V36 and above). *)
  1799.   (* bit 7 is always clear for fonts on the graphics font list *)
  1800.   fpRemoved *     = 7;      (* the font has been removed *)
  1801.  
  1802. TYPE
  1803.  
  1804. (****** TextAttr node, matches text attributes in RastPort **********)
  1805.   TextAttr * = RECORD
  1806.     name *  : E.STRPTR;         (* name of the font *)
  1807.     ySize * : E.UWORD;          (* height of the font *)
  1808.     style * : E.BSET;           (* intrinsic font style *)
  1809.     flags * : E.BSET;           (* font preferences and flags *)
  1810.   END; (* TextAttr *)
  1811.  
  1812.   TTextAttr * = RECORD
  1813.     name *  : E.STRPTR;        (* name of the font *)
  1814.     ySize * : E.UWORD;         (* height of the font *)
  1815.     style * : E.BSET;          (* intrinsic font style *)
  1816.     flags * : E.BSET;          (* font preferences and flags *)
  1817.     tags *  : U.TagListPtr;    (* extended attributes *)
  1818.   END; (* TTextAttr *)
  1819.  
  1820.  
  1821. CONST
  1822.  
  1823. (****** Text Tags ************************************************** *)
  1824.   deviceDPI * = U.tagUser+1;    (* Tag value is Point union: *)
  1825.                                 (* Hi word XDPI, Lo word YDPI *)
  1826.  
  1827.   maxFontMatchweight *      = 32767;   (* perfect match from WeighTAMatch *)
  1828.  
  1829.  
  1830. TYPE
  1831.  
  1832. (****** TextFonts node **********************************************)
  1833.   TextFont * = RECORD (E.Message) (* reply message for font removal *)
  1834.                                   (* font name in LN        \    used in this *)
  1835.     ySize *     : E.UWORD;        (* font height            |    order to best *)
  1836.     style *     : E.BSET;         (* font style             |    match a font *)
  1837.     flags *     : E.BSET;         (* preferences and flags  /    request. *)
  1838.     xSize *     : E.UWORD;        (* nominal font width *)
  1839.     baseline *  : E.UWORD;        (* distance from the top of char to baseline *)
  1840.     boldSmear * : E.UWORD;        (* smear to affect a bold enhancement *)
  1841.  
  1842.     accessors * : E.UWORD;        (* access count *)
  1843.  
  1844.     loChar *    : CHAR;           (* the first character described here *)
  1845.     hiChar *    : CHAR;           (* the last character described here *)
  1846.     charData *  : E.APTR;         (* the bit character data *)
  1847.  
  1848.     modulo *    : E.UWORD;        (* the row modulo for the strike font data *)
  1849.     charLoc *   : E.APTR;         (* ptr to location data for the strike font *)
  1850.                                   (*   2 words: bit offset then size *)
  1851.     charSpace * : E.APTR;         (* ptr to words of proportional spacing data *)
  1852.     charKern *  : E.APTR;         (* ptr to words of kerning data *)
  1853.   END; (* TextFont *)
  1854.  
  1855.  
  1856. CONST
  1857.  
  1858. (* ----- TextFontExtension.flags0 (partial definition) ---------------------------- *)
  1859.   te0NoRemFont *  = 0;       (* disallow RemFont for this font *)
  1860.  
  1861. TYPE
  1862.  
  1863.   TextFontExtension * = RECORD
  1864.     matchWord *     : E.UWORD;      (* a magic cookie for the extension *)
  1865.     flags0          : E.BSET;       (* (system private flags) *)
  1866.     flags1          : E.BSET;       (* (system private flags) *)
  1867.     backPtr *       : TextFontPtr;  (* validation of compilation *)
  1868.     origReplyPort * : E.MsgPortPtr; (* original value in tfExtension *)
  1869.     tags *          : U.TagListPtr; (* Text Tags for the font *)
  1870.     oFontPatchS     : E.APTR;       (* (system private use) *)
  1871.     oFontPatchK     : E.APTR;       (* (system private use) *)
  1872.     (* this space is reserved for future expansion *)
  1873.   END; (* TextFontExtension *)
  1874.  
  1875. CONST
  1876.  
  1877. (****** ColorTextFont node ******************************************)
  1878. (* ----- ctfFlags -------------------------------------------------- *)
  1879.   ctColorMask *    = {0..3};  (* mask to get to following color styles *)
  1880.   ctColorFont *    = 0;       (* color map contains designer's colors *)
  1881.   ctGreyFont *     = 1;       (* color map describes even-stepped *)
  1882.                               (* brightnesses from low to high *)
  1883.   ctAntiAlias *    = 2;       (* zero background thru fully saturated char *)
  1884.  
  1885.   ctMapColor *     = 0;       (* map ctfFgColor to the rpFgPen if it's *)
  1886.                               (* is a valid color within ctfLow..ctfHigh *)
  1887.  
  1888. TYPE
  1889.  
  1890. (*----- ColorFontColors --------------------------------------------*)
  1891.   ColorFontColors * = RECORD
  1892.     reserved *   : E.UWORD; (*  *must* be zero *)
  1893.     count *      : E.UWORD; (* number of entries in ColorTable *)
  1894.     colorTable * : E.APTR;  (* 4 bit per component color map packed xRGB *)
  1895.   END; (* ColorFontColors *)
  1896.  
  1897. (*----- ColorTextFont ----------------------------------------------*)
  1898.   ColorTextFont * = RECORD (TextFont)
  1899.     ctfFlags *    : E.WSET;   (* extended flags *)
  1900.     depth *       : E.UBYTE;  (* number of bit planes *)
  1901.     fgColor *     : E.UBYTE;  (* color that is remapped to FgPen *)
  1902.     low *         : E.UBYTE;  (* lowest color represented here *)
  1903.     high *        : E.UBYTE;  (* highest color represented here *)
  1904.     planePick *   : E.BSET;   (* PlanePick ala Images *)
  1905.     planeOnOff *  : E.BSET;   (* PlaneOnOff ala Images *)
  1906.     colorFontColors * : ColorFontColorsPtr; (* colors for font *)
  1907.     ctfCharData * : ARRAY 8 OF E.APTR; (* pointers to bit planes ala tfCharData *)
  1908.   END; (* ColorTextFont *)
  1909.  
  1910. (****** TextExtent node *********************************************)
  1911.   TextExtent * = RECORD
  1912.     width *  : E.UWORD;   (* same as TextLength *)
  1913.     height * : E.UWORD;   (* same as tfYSize *)
  1914.     extent * : Rectangle; (* relative to CP *)
  1915.   END; (* TextExtent *)
  1916.  
  1917.  
  1918. (*
  1919. **      $VER: videocontrol.h 39.8 (31.5.93)
  1920. **
  1921. **      definitions for videocontrol commands
  1922. *)
  1923.  
  1924.  
  1925. CONST
  1926.  
  1927.   vtagEndCM *             = 00000000H;
  1928.   vtagChromaKeyClr *      = 80000000H;
  1929.   vtagChromaKeySet *      = 80000001H;
  1930.   vtagBitPlaneKeyClr *    = 80000002H;
  1931.   vtagBitPlaneKeySet *    = 80000003H;
  1932.   vtagBorderBlankClr *    = 80000004H;
  1933.   vtagBorderBlankSet *    = 80000005H;
  1934.   vtagBorderNoTransClr *  = 80000006H;
  1935.   vtagBorderNoTransSet *  = 80000007H;
  1936.   vtagChromaPenClr *      = 80000008H;
  1937.   vtagChromaPenSet *      = 80000009H;
  1938.   vtagChromaPlaneSet *    = 8000000AH;
  1939.   vtagAttachCMSet *       = 8000000BH;
  1940.   vtagNextBufCM *         = 8000000CH;
  1941.   vtagBatchCMClr *        = 8000000DH;
  1942.   vtagBatchCMSet *        = 8000000EH;
  1943.   vtagNormalDispGet *     = 8000000FH;
  1944.   vtagNormalDispSet *     = 80000010H;
  1945.   vtagCoerceDispGet *     = 80000011H;
  1946.   vtagCoerceDispSet *     = 80000012H;
  1947.   vtagViewPortExtraGet *  = 80000013H;
  1948.   vtagViewPortExtraSet *  = 80000014H;
  1949.   vtagChromaKeyGet *      = 80000015H;
  1950.   vtagBitplaneKeyGet *    = 80000016H;
  1951.   vtagBorderBlankGet *    = 80000017H;
  1952.   vtagBorderNoTransGet *  = 80000018H;
  1953.   vtagChromaPenGet *      = 80000019H;
  1954.   vtagChromaPlaneGet *    = 8000001AH;
  1955.   vtagAttachCMGet *       = 8000001BH;
  1956.   vtagBatchCMGet *        = 8000001CH;
  1957.   vtagBatchItemsGet *     = 8000001DH;
  1958.   vtagBatchItemsSet *     = 8000001EH;
  1959.   vtagBatchItemsAdd *     = 8000001FH;
  1960.   vtagVPModeIDGet *       = 80000020H;
  1961.   vtagVPModeIDSet *       = 80000021H;
  1962.   vtagVPModeIDClr *       = 80000022H;
  1963.   vtagUserClipGet *       = 80000023H;
  1964.   vtagUserClipSet *       = 80000024H;
  1965.   vtagUserClipClr *       = 80000025H;
  1966.  
  1967. (* The following tags are V39 specific. They will be ignored (returing error -3) by
  1968.         earlier versions *)
  1969.   vtagPf1BaseGet *        = 080000026H;
  1970.   vtagPf2BaseGet *        = 080000027H;
  1971.   vtagSpEvenBaseGet *     = 080000028H;
  1972.   vtagSpOddBaseGet *      = 080000029H;
  1973.   vtagPf1BaseSet *        = 08000002AH;
  1974.   vtagPf2BaseSet *        = 08000002BH;
  1975.   vtagSpEvenBaseSet *     = 08000002CH;
  1976.   vtagSpOddBaseSet *      = 08000002DH;
  1977.   vtagBorderSpriteGet *   = 08000002EH;
  1978.   vtagBorderSpriteSet *   = 08000002FH;
  1979.   vtagBorderSpriteClr *   = 080000030H;
  1980.   vtagSpriteResnSet *     = 080000031H;
  1981.   vtagSpriteResnGet *     = 080000032H;
  1982.   vtagPf1ToSpritePriSet * = 080000033H;
  1983.   vtagPf1ToSpritePriGet * = 080000034H;
  1984.   vtagPf2ToSpritePriSet * = 080000035H;
  1985.   vtagPf2ToSpritePriGet * = 080000036H;
  1986.   vtagImmediate *         = 080000037H;
  1987.   vtagFullPaletteSet *    = 080000038H;
  1988.   vtagFullPaletteGet *    = 080000039H;
  1989.   vtagFullPaletteClr *    = 08000003AH;
  1990.   vtagDefSpriteResnSet *  = 08000003BH;
  1991.   vtagDefSpriteResnGet *  = 08000003CH;
  1992.  
  1993. (* all the following tags follow the new, rational standard for videocontrol tags:
  1994.  * VC_xxx,state         set the state of attribute 'xxx' to value 'state'
  1995.  * VC_xxx_QUERY,&var    get the state of attribute 'xxx' and store it into the longword
  1996.  *                      pointed to by &var.
  1997.  *
  1998.  * The following are new for V40:
  1999.  *)
  2000.  
  2001.   vcIntermediateCLUpdate *      = 080000080H;
  2002.         (* default=true. When set graphics will update the intermediate copper
  2003.          * lists on color changes, etc. When false, it won't, and will be faster.
  2004.          *)
  2005.   vcIntermediateCLUpdateQuery * = 080000081H;
  2006.  
  2007.   vcNoColorPaletteLoad *        = 080000082H;
  2008.         (* default = false. When set, graphics will only load color 0
  2009.          * for this ViewPort, and so the ViewPort's colors will come
  2010.          * from the previous ViewPort's.
  2011.          *
  2012.          * NB - Using this tag and VTAG_FULLPALETTE_SET together is undefined.
  2013.          *)
  2014.   vcNoColorPaletteLoadQuery *   = 080000083H;
  2015.  
  2016.   vcDualPFDisable *             = 080000084H;
  2017.         (* default = false. When this flag is set, the dual-pf bit
  2018.            in Dual-Playfield screens will be turned off. Even bitplanes
  2019.            will still come from the first BitMap and odd bitplanes
  2020.            from the second BitMap, and both R[xy]Offsets will be
  2021.            considered. This can be used (with appropriate palette
  2022.            selection) for cross-fades between differently scrolling
  2023.            images.
  2024.            When this flag is turned on, colors will be loaded for
  2025.            the viewport as if it were a single viewport of depth
  2026.            depth1+depth2 *)
  2027.   vcDualPFDisableQuery *        = 080000085H;
  2028.  
  2029.  
  2030. (*
  2031. **      $VER: graphint.h 39.0 (23.9.91)
  2032. **
  2033. **      structure used by AddTOFTask
  2034. *)
  2035.  
  2036.  
  2037. TYPE
  2038.  
  2039.   Isrvstr * = RECORD (E.Node)
  2040.     iptr *  : IsrvstrPtr;   (* passed to srvr by os *)
  2041.     code *  : E.PROC;
  2042.     ccode * : E.PROC;
  2043.     carg *  : LONGINT;
  2044.   END; (* Isrvstr *)
  2045.  
  2046.  
  2047. (*
  2048. **      $VER: scale.h 39.0 (21.8.91)
  2049. **
  2050. **      structure argument to BitMapScale()
  2051. *)
  2052.  
  2053.  
  2054. TYPE
  2055.  
  2056.   BitScaleArgs * = RECORD
  2057.     srcX *,        srcY *        : E.UWORD; (* source origin *)
  2058.     srcWidth *,    srcHeight *   : E.UWORD; (* source size *)
  2059.     xSrcFactor *,  ySrcFactor *  : E.UWORD; (* scale factor denominators *)
  2060.     destX *,       destY *       : E.UWORD; (* destination origin *)
  2061.     destWidth *,   destHeight *  : E.UWORD; (* destination size result *)
  2062.     xDestFactor *, yDestFactor * : E.UWORD; (* scale factor numerators *)
  2063.     srcBitMap *  : BitMapPtr;               (* source BitMap *)
  2064.     destBitMap * : BitMapPtr;               (* destination BitMap *)
  2065.     flags *      : E.ULONG;                 (* reserved.  Must be zero! *)
  2066.     xdda, ydda   : E.UWORD;                 (* reserved *)
  2067.     reserved1    : LONGINT;
  2068.     reserved2    : LONGINT;
  2069.   END; (* BitScaleArgs *)
  2070.  
  2071. (*
  2072. **      $VER: coerce.h 39.3 (15.2.93)
  2073. **
  2074. **      mode coercion definitions
  2075. *)
  2076.  
  2077. (* These flags are passed (in combination) to CoerceMode() to determine the
  2078.  * type of coercion required.
  2079.  *)
  2080.  
  2081. CONST
  2082.  
  2083. (* Ensure that the mode coerced to can display just as many colours as the
  2084.  * ViewPort being coerced.
  2085.  *)
  2086.   preserveColors * = 1;
  2087.  
  2088. (* Ensure that the mode coerced to is not interlaced. *)
  2089.   avoidFlicker * = 2;
  2090.  
  2091. (* Coercion should ignore monitor compatibility issues. *)
  2092.   ignoreMCompat * = 4;
  2093.  
  2094.  
  2095.   bidTagCoerce = 1;    (* Private *)
  2096.  
  2097. (*
  2098. **      $VER: rpattr.h 39.2 (31.5.93)
  2099. **
  2100. **      tag definitions for GetRPAttr, SetRPAttr
  2101. *)
  2102.  
  2103. CONST
  2104.  
  2105.   rpTagFont *       = 080000000H;  (* get/set font *)
  2106.   rpTagAPen *       = 080000002H;  (* get/set apen *)
  2107.   rpTagBPen *       = 080000003H;  (* get/set bpen *)
  2108.   rpTagDrMd *       = 080000004H;  (* get/set draw mode *)
  2109.   rpTagOutLinePen * = 080000005H;  (* get/set outline pen *)
  2110.   rpTagOutlinePen * = 080000005H;  (* get/set outline pen. corrected case. *)
  2111.   rpTagWriteMask *  = 080000006H;  (* get/set WriteMask *)
  2112.   rpTagMaxPen *     = 080000007H;  (* get/set maxpen *)
  2113.  
  2114.   rpTagDrawBounds * = 080000008H;  (* get only rastport draw bounds. pass &rect *)
  2115.  
  2116. (*
  2117. **      $VER: gfxbase.h 39.21 (21.4.93)
  2118. **
  2119. **      graphics base definitions
  2120. *)
  2121.  
  2122.  
  2123. TYPE
  2124.  
  2125.   GfxBasePtr * = CPOINTER TO GfxBase;
  2126.   GfxBase * = RECORD (E.Library)
  2127.     actiView * : ViewPtr;
  2128.     copinit *  : CopinitPtr;           (* ptr to copper start up list *)
  2129.     cia *      : E.APTR;               (* for 8520 resource use *)
  2130.     blitter *  : E.APTR;               (* for future blitter resource use *)
  2131.     loFlist *  : E.APTR;
  2132.     shFlist *  : E.APTR;
  2133.     blthd *, blttl *     : H.BltnodePtr;
  2134.     bsblthd *, bsblttl * : H.BltnodePtr;
  2135.     vbsrv *, timsrv *, bltsrv * : E.Interrupt;
  2136.     textFonts * : E.List;
  2137.     defaultFont * : TextFontPtr;
  2138.     modes *    : E.WSET;               (* copy of current first bplcon0 *)
  2139.     vBlank *   : SHORTINT;
  2140.     debug *    : SHORTINT;
  2141.     beamSync * : INTEGER;
  2142.     systembplcon0 * : E.WSET; (* it is ored into each bplcon0 for display *)
  2143.     spriteReserved * : E.UBYTE;
  2144.     bytereserved * : E.UBYTE;
  2145.     Flags * : E.WSET;
  2146.     blitLock * : INTEGER;
  2147.     blitNest * : INTEGER;
  2148.  
  2149.     blitWaitQ * : E.List;
  2150.     blitOwner * : E.TaskPtr;
  2151.     tofWaitQ *  : E.List;
  2152.     displayFlags * : E.WSET;           (* NTSC PAL GENLOC etc *)
  2153.                                        (* flags initialized at power on *)
  2154.     simpleSprites * : SimpleSpritePtr;
  2155.     maxDisplayRow * : E.UWORD;          (* hardware stuff, do not use *)
  2156.     maxDisplayColumn * : E.UWORD;       (* hardware stuff, do not use *)
  2157.     normalDisplayRows * : E.UWORD;
  2158.     normalDisplayColumns * : E.UWORD;
  2159.     (* the following are for standard non interlace, 1/2 wb width *)
  2160.     normalDPMX * : E.UWORD;             (* Dots per meter on display *)
  2161.     normalDPMY * : E.UWORD;             (* Dots per meter on display *)
  2162.     lastChanceMemory * : E.SignalSemaphorePtr;
  2163.     lcMptr * : E.APTR;
  2164.     microsPerLine * : E.UWORD;          (* 256 time usec/line *)
  2165.     minDisplayColumn * : E.UWORD;
  2166.     chipRevBits0 * : E.BSET;
  2167.     memType * :  E.UBYTE;
  2168.     reserved * : ARRAY 4 OF E.UBYTE;
  2169.     monitorid * : E.UWORD;             (* normally null *)
  2170.     hedley * : ARRAY 8 OF E.ULONG;
  2171.     hedleySprites * : ARRAY 8 OF E.ULONG;     (* sprite ptrs for intuition mouse *)
  2172.     hedleySprites1 * : ARRAY 8 OF E.ULONG;            (* sprite ptrs for intuition mouse *)
  2173.     hedleyCount * : INTEGER;
  2174.     hedleyFlags * : E.WSET;
  2175.     hedleyTmp * : INTEGER;
  2176.     hashTable * : E.APTR;
  2177.     currentTotRows * : E.UWORD;
  2178.     currentTotCclks * : E.UWORD;
  2179.     hedleyHint * : E.UBYTE;
  2180.     hedleyHint2 * : E.UBYTE;
  2181.     nreserved * : ARRAY 4 OF E.ULONG;
  2182.     a2024SyncRaster * : E.APTR;
  2183.     controlDeltaPAL * : INTEGER;
  2184.     controlDeltaNTSC * : INTEGER;
  2185.     currentMonitor * : MonitorSpecPtr;
  2186.     monitorList * : E.List;
  2187.     defaultMonitor * : MonitorSpecPtr;
  2188.     monitorListSemaphore * : E.SignalSemaphorePtr;
  2189.     displayInfoDataBase * : E.APTR;
  2190.     topLine * : INTEGER;
  2191.     actiViewCprSemaphore * : E.SignalSemaphorePtr;
  2192.     utilBase * : E.LibraryPtr;           (* for hook and tag utilities   *)
  2193.     execBase * : E.LibraryPtr;              (* to link with rom.lib *)
  2194.     bwshifts * :  E.APTR;
  2195.     strtFetchMasks * :  E.APTR;
  2196.     stopFetchMasks * :  E.APTR;
  2197.     overrun * :  E.APTR;
  2198.     realStops * :  E.APTR;
  2199.     spriteWidth * :  E.UWORD;   (* current width (in words) of sprites *)
  2200.     spriteFMode * :  E.UWORD;           (* current sprite fmode bits    *)
  2201.     softSprites * :  SHORTINT;  (* bit mask of size change knowledgeable sprites *)
  2202.     arraywidth * :  SHORTINT;
  2203.     defaultSpriteWidth * :  E.UWORD;    (* what width intuition wants *)
  2204.     sprMoveDisable * :  SHORTINT;
  2205.     wantChips * :  E.UBYTE;
  2206.     boardMemType * :  E.UBYTE;
  2207.     bugs * :  E.UBYTE;
  2208.     layersBase * :  E.APTR;
  2209.     colorMask * :  E.ULONG;
  2210.     iVector * :  E.APTR;
  2211.     iData * :  E.APTR;
  2212.     specialCounter * :  E.ULONG;        (* special for double buffering *)
  2213.     dBList * :  E.APTR;
  2214.     monitorFlags * :  E.WSET;
  2215.     scanDoubledSprites * :  E.UBYTE;
  2216.     bP3Bits * :  E.UBYTE;
  2217.     monitorVBlank * :  AnalogSignalInterval;
  2218.     monitor * :  MonitorSpecPtr;
  2219.     progData * :  E.APTR;
  2220.     extSprites * :  E.UBYTE;
  2221.     pad3 * :  E.UBYTE;
  2222.     gfxFlags * :  E.WSET;
  2223.     vBCounter * :  E.ULONG;
  2224.     hashTableSemaphore * :  E.SignalSemaphorePtr;
  2225.     hWEmul * :  ARRAY 9 OF E.APTR;
  2226.   END; (* GfxBase *)
  2227.  
  2228. CONST
  2229.  
  2230. (* Values for gfxBase.displayFlags *)
  2231.   ntsc *            = 1;
  2232.   genloc *          = 2;
  2233.   pal *             = 4;
  2234.   todaSafe *        = 8;
  2235.   reallyPAL *       = 16;  (* what is actual crystal frequency
  2236.                               (as opposed to what bootmenu set the agnus to)?
  2237.                               (V39) *)
  2238.   lpenSwapFrames *  = 32;
  2239.                            (* LightPen software could set this bit if the
  2240.                             * "lpen-with-interlace" fix put in for V39
  2241.                             * does not work. This is true of a number of
  2242.                             * Agnus chips.
  2243.                             * (V40).
  2244.                             *)
  2245.  
  2246.   blitMsgFault *   = 4;
  2247.  
  2248. (* bits defs for ChipRevBits *)
  2249.   bigBlits *  = 0;
  2250.   hrAgnus *   = 0;
  2251.   hrDenise *  = 1;
  2252.   aaAlice *   = 2;
  2253.   aaLisa *    = 3;
  2254.   aaMLisa     = 4;  (* internal use only. *)
  2255.  
  2256. (* Pass ONE of these to SetChipRev() *)
  2257.   setChipRevA *    = {hrAgnus};
  2258.   setChipRevECS *  = {hrAgnus, hrDenise};
  2259.   setChipRevAA *   = {aaAlice, aaLisa} + setChipRevECS;
  2260.   setChipRevBest * = {0..31};
  2261.  
  2262. (* memory type *)
  2263.   bus16 *          = 0;
  2264.   nmlCAS *         = 0;
  2265.   bus32 *          = 1;
  2266.   dblCAS *         = 2;
  2267.   bandwidth1x *    = {bus16, nmlCAS};
  2268.   bandwidth2xNml * = {bus32};
  2269.   bandwidth2xDbl * = {dblCAS};
  2270.   bandwidth4x *    = {bus32, dblCAS};
  2271.  
  2272. (* GfxFlags (private) *)
  2273.   newDatabase = 1;
  2274.  
  2275.   name *    = "graphics.library";
  2276.  
  2277. (**-- Library Base variable --------------------------------------------*)
  2278.  
  2279.  
  2280. VAR
  2281.  
  2282.   base * : GfxBasePtr;
  2283.  
  2284.  
  2285. (**-- Library Functions ------------------------------------------------*)
  2286.  
  2287. (*
  2288. **      $VER: graphics_protos.h 39.31 (29.4.93)
  2289. *)
  2290.  
  2291. TYPE
  2292.   CollisionProc* = PROCEDURE (GELA, GELB : VSpritePtr);
  2293.  
  2294.  
  2295. (* ------ BitMap primitives ------*)
  2296.  
  2297. LIBCALL (base : GfxBasePtr) BltBitMap*
  2298.   ( srcBitMap  [8] : BitMapPtr;
  2299.     xSrc       [0] : INTEGER;
  2300.     ySrc       [1] : INTEGER;
  2301.     destBitMap [9] : BitMapPtr;
  2302.     xDest      [2] : INTEGER;
  2303.     yDest      [3] : INTEGER;
  2304.     xSize      [4] : INTEGER;
  2305.     ySize      [5] : INTEGER;
  2306.     minterm    [6] : E.UBYTE;
  2307.     mask       [7] : E.BSET;
  2308.     tempA     [10] : PlanePtr )
  2309.   : E.ULONG;
  2310.   -30;
  2311.  
  2312. LIBCALL (base : GfxBasePtr) BltTemplate*
  2313.   ( source [8] : PlanePtr;
  2314.     xSrc   [0] : INTEGER;
  2315.     srcMod [1] : INTEGER;
  2316.     destRP [9] : RastPortPtr;
  2317.     xDest  [2] : INTEGER;
  2318.     yDest  [3] : INTEGER;
  2319.     xSize  [4] : INTEGER;
  2320.     ySize  [5] : INTEGER );
  2321.   -36;
  2322.  
  2323. (* ------ Text routines ------*)
  2324.  
  2325. LIBCALL (base : GfxBasePtr) ClearEOL*
  2326.   ( rp [9] : RastPortPtr );
  2327.   -42;
  2328. LIBCALL (base : GfxBasePtr) ClearScreen*
  2329.   ( rp [9] : RastPortPtr );
  2330.   -48;
  2331. LIBCALL (base : GfxBasePtr) TextLength*
  2332.   ( rp [9] : RastPortPtr;
  2333.     string [8] : ARRAY OF CHAR;
  2334.     count  [0] : LONGINT )
  2335.   : INTEGER;
  2336.   -54;
  2337. LIBCALL (base : GfxBasePtr) Text*
  2338.   ( rp     [9] : RastPortPtr;
  2339.     string [8] : ARRAY OF CHAR;
  2340.     count  [0] : LONGINT );
  2341.   -60;
  2342. LIBCALL (base : GfxBasePtr) SetFont*
  2343.   ( rp       [9] : RastPortPtr;
  2344.     textFont [8] : TextFontPtr );
  2345.   -66;
  2346. LIBCALL (base : GfxBasePtr) OpenFont*
  2347.   ( VAR textAttr [8] : TextAttr )
  2348.   : TextFontPtr;
  2349.   -72;
  2350. LIBCALL (base : GfxBasePtr) CloseFont*
  2351.   ( textFont [9] : TextFontPtr );
  2352.   -78;
  2353. LIBCALL (base : GfxBasePtr) AskSoftStyle*
  2354.   ( rp [9] : RastPortPtr )
  2355.   : E.BSET;
  2356.   -84;
  2357. LIBCALL (base : GfxBasePtr) SetSoftStyle*
  2358.   ( rp     [9] : RastPortPtr;
  2359.     style  [0] : E.BSET;
  2360.     enable [1] : E.BSET )
  2361.   : E.BSET;
  2362.   -90;
  2363.  
  2364. (* ------ Gels routines ------*)
  2365.  
  2366. LIBCALL (base : GfxBasePtr) AddBob*
  2367.   ( bob [8] : BobPtr;
  2368.     rp  [9] : RastPortPtr );
  2369.   -96;
  2370. LIBCALL (base : GfxBasePtr) AddVSprite*
  2371.   ( vSprite [8] : VSpritePtr;
  2372.     rp      [9] : RastPortPtr );
  2373.   -102;
  2374. LIBCALL (base : GfxBasePtr) DoCollision*
  2375.   ( rp [9] : RastPortPtr );
  2376.   -108;
  2377. LIBCALL (base : GfxBasePtr) DrawGList*
  2378.   ( rp [9] : RastPortPtr;
  2379.     vp [8] : ViewPortPtr );
  2380.   -114;
  2381. LIBCALL (base : GfxBasePtr) InitGels*
  2382.   ( head      [8] : VSpritePtr;
  2383.     tail      [9] : VSpritePtr;
  2384.     gelsInfo [10] : GelsInfoPtr );
  2385.   -120;
  2386. LIBCALL (base : GfxBasePtr) InitMasks*
  2387.   ( vSprite [0] : VSpritePtr );
  2388.   -126;
  2389. LIBCALL (base : GfxBasePtr) RemIBob*
  2390.   ( bob [8] : BobPtr;
  2391.     rp  [9] : RastPortPtr;
  2392.     vp [10] : ViewPortPtr );
  2393.   -132;
  2394. LIBCALL (base : GfxBasePtr) RemVSprite*
  2395.   ( vSprite [8] : VSpritePtr );
  2396.   -138;
  2397. LIBCALL (base : GfxBasePtr) SetCollision*
  2398.   ( num      [0] : E.ULONG;
  2399.     routine  [8] : CollisionProc;
  2400.     gelsInfo [9] : GelsInfoPtr );
  2401.   -144;
  2402. LIBCALL (base : GfxBasePtr) SortGList*
  2403.   ( rp [9] : RastPortPtr );
  2404.   -150;
  2405. LIBCALL (base : GfxBasePtr) AddAnimOb*
  2406.   ( anOb      [8] : AnimObPtr;
  2407.     VAR anKey [9] : AnimObPtr;
  2408.     rp       [10] : RastPortPtr );
  2409.   -156;
  2410. LIBCALL (base : GfxBasePtr) Animate*
  2411.   ( VAR anKey [8] : AnimObPtr;
  2412.     rp        [9] : RastPortPtr );
  2413.   -162;
  2414. LIBCALL (base : GfxBasePtr) GetGBuffers*
  2415.   ( anOb [8] : AnimObPtr;
  2416.     rp   [9] : RastPortPtr;
  2417.     flag [0] : BOOLEAN )
  2418.   : BOOLEAN;
  2419.   -168;
  2420. LIBCALL (base : GfxBasePtr) InitGMasks*
  2421.   ( anOb [8] : AnimObPtr );
  2422.   -174;
  2423.  
  2424. (* ------        General graphics routines ------*)
  2425.  
  2426. LIBCALL (base : GfxBasePtr) DrawEllipse*
  2427.   ( rp      [9] : RastPortPtr;
  2428.     xCenter [0] : INTEGER;
  2429.     yCenter [1] : INTEGER;
  2430.     a       [2] : INTEGER;
  2431.     b       [3] : INTEGER );
  2432.   -180;
  2433. LIBCALL (base : GfxBasePtr) AreaEllipse*
  2434.   ( rp      [9] : RastPortPtr;
  2435.     xCenter [0] : INTEGER;
  2436.     yCenter [1] : INTEGER;
  2437.     a       [2] : INTEGER;
  2438.     b       [3] : INTEGER )
  2439.   : BOOLEAN;
  2440.   -186;
  2441. LIBCALL (base : GfxBasePtr) LoadRGB4*
  2442.   ( vp     [8] : ViewPortPtr;
  2443.     colors [1] : ARRAY OF E.UWORD;
  2444.     count  [0] : LONGINT );
  2445.   -192;
  2446. LIBCALL (base : GfxBasePtr) InitRastPort*
  2447.   ( VAR rp [9] : RastPort );
  2448.   -198;
  2449. LIBCALL (base : GfxBasePtr) InitVPort*
  2450.   ( VAR vp [8] : ViewPort );
  2451.   -204;
  2452. LIBCALL (base : GfxBasePtr) OldMrgCop*
  2453.   ( view [9] : ViewPtr );
  2454.   -210;
  2455. LIBCALL (base : GfxBasePtr) MrgCop*
  2456.   ( view [9] : ViewPtr )
  2457.   : LONGINT;
  2458.   -210;
  2459. LIBCALL (base : GfxBasePtr) MakeVPort*
  2460.   ( view [8] : ViewPtr;
  2461.     vp   [9] : ViewPortPtr );
  2462.   -216;
  2463. LIBCALL (base : GfxBasePtr) LoadView*
  2464.   ( view [9] : ViewPtr );
  2465.   -222;
  2466. LIBCALL (base : GfxBasePtr) WaitBlit* ();
  2467.   -228;
  2468. LIBCALL (base : GfxBasePtr) SetRast*
  2469.   ( rp  [9] : RastPortPtr;
  2470.     pen [0] : E.UBYTE );
  2471.   -234;
  2472. LIBCALL (base : GfxBasePtr) Move*
  2473.   ( rp [9] : RastPortPtr;
  2474.     x  [0] : INTEGER;
  2475.     y  [1] : INTEGER );
  2476.   -240;
  2477. LIBCALL (base : GfxBasePtr) Draw*
  2478.   ( rp [9] : RastPortPtr;
  2479.     x  [0] : INTEGER;
  2480.     y  [1] : INTEGER );
  2481.   -246;
  2482. LIBCALL (base : GfxBasePtr) AreaMove*
  2483.   ( rp [9] : RastPortPtr;
  2484.     x  [0] : INTEGER;
  2485.     y  [1] : INTEGER )
  2486.   : BOOLEAN;
  2487.   -252;
  2488. LIBCALL (base : GfxBasePtr) AreaDraw*
  2489.   ( rp [9] : RastPortPtr;
  2490.     x  [0] : INTEGER;
  2491.     y  [1] : INTEGER )
  2492.   : BOOLEAN;
  2493.   -258;
  2494. LIBCALL (base : GfxBasePtr) AreaEnd*
  2495.   ( rp [9] : RastPortPtr )
  2496.   : BOOLEAN;
  2497.   -264;
  2498. LIBCALL (base : GfxBasePtr) WaitTOF* ();
  2499.   -270;
  2500. LIBCALL (base : GfxBasePtr) QBlit*
  2501.   ( blit [9] : H.BltnodePtr );
  2502.   -276;
  2503. LIBCALL (base : GfxBasePtr) InitArea*
  2504.   ( VAR areaInfo [8] : AreaInfo;
  2505.     vectorBuffer [9] : E.APTR;
  2506.     maxVectors   [0] : LONGINT );
  2507.   -282;
  2508. LIBCALL (base : GfxBasePtr) SetRGB4*
  2509.   ( vp    [8] : ViewPortPtr;
  2510.     index [0] : LONGINT;
  2511.     red   [1] : E.UBYTE;
  2512.     green [2] : E.UBYTE;
  2513.     blue  [3] : E.UBYTE );
  2514.   -288;
  2515. LIBCALL (base : GfxBasePtr) QBSBlit*
  2516.   ( blit [9] : H.BltnodePtr );
  2517.   -294;
  2518. LIBCALL (base : GfxBasePtr) BltClear*
  2519.   ( memBlock  [9] : PlanePtr;
  2520.     byteCount [0] : E.ULONG;
  2521.     flags     [1] : SET );
  2522.   -300;
  2523. LIBCALL (base : GfxBasePtr) RectFill*
  2524.   ( rp   [9] : RastPortPtr;
  2525.     xMin [0] : INTEGER;
  2526.     yMin [1] : INTEGER;
  2527.     xMax [2] : INTEGER;
  2528.     yMax [3] : INTEGER );
  2529.   -306;
  2530. LIBCALL (base : GfxBasePtr) BltPattern*
  2531.   ( rp      [9] : RastPortPtr;
  2532.     mask    [8] : PlanePtr;
  2533.     xMin    [0] : INTEGER;
  2534.     yMin    [1] : INTEGER;
  2535.     xMax    [2] : INTEGER;
  2536.     yMax    [3] : INTEGER;
  2537.     maskBPR [4] : INTEGER );
  2538.   -312;
  2539. LIBCALL (base : GfxBasePtr) ReadPixel*
  2540.   ( rp [9] : RastPortPtr;
  2541.     x  [0] : INTEGER;
  2542.     y  [1] : INTEGER )
  2543.   : LONGINT;
  2544.   -318;
  2545. LIBCALL (base : GfxBasePtr) WritePixel*
  2546.   ( rp [9] : RastPortPtr;
  2547.     x  [0] : INTEGER;
  2548.     y  [1] : INTEGER )
  2549.   : BOOLEAN;
  2550.   -324;
  2551. LIBCALL (base : GfxBasePtr) Flood*
  2552.   ( rp   [9] : RastPortPtr;
  2553.     mode [2] : E.ULONG;
  2554.     x    [0] : INTEGER;
  2555.     y    [1] : INTEGER )
  2556.   : BOOLEAN;
  2557.   -330;
  2558. LIBCALL (base : GfxBasePtr) PolyDraw*
  2559.   ( rp        [9] : RastPortPtr;
  2560.     count     [0] : INTEGER;
  2561.     polyTable [8] : ARRAY OF Point );
  2562.   -336;
  2563. LIBCALL (base : GfxBasePtr) PolyDrawList*
  2564.   ( rp        [9]   : RastPortPtr;
  2565.     count     [0]   : INTEGER;
  2566.     polyTable [8].. : INTEGER );
  2567.   -336;
  2568. LIBCALL (base : GfxBasePtr) SetAPen*
  2569.   ( rp  [9] : RastPortPtr;
  2570.     pen [0] : E.UBYTE );
  2571.   -342;
  2572. LIBCALL (base : GfxBasePtr) SetBPen*
  2573.   ( rp  [9] : RastPortPtr;
  2574.     pen [0] : E.UBYTE );
  2575.   -348;
  2576. LIBCALL (base : GfxBasePtr) SetDrMd*
  2577.   ( rp       [9] : RastPortPtr;
  2578.     drawMode [0] : E.BSET );
  2579.   -354;
  2580. LIBCALL (base : GfxBasePtr) InitView*
  2581.   ( VAR view [9] : View );
  2582.   -360;
  2583. LIBCALL (base : GfxBasePtr) CBump*
  2584.   ( copList [9] : UCopListPtr );
  2585.   -366;
  2586. LIBCALL (base : GfxBasePtr) CMove*
  2587.   ( copList     [9] : UCopListPtr;
  2588.     destination [0] : E.APTR;
  2589.     data        [1] : E.UWORD );
  2590.   -372;
  2591. LIBCALL (base : GfxBasePtr) CWait*
  2592.   ( copList [9] : UCopListPtr;
  2593.     v       [0] : INTEGER;
  2594.     h       [1] : INTEGER );
  2595.   -378;
  2596. LIBCALL (base : GfxBasePtr) VBeamPos* ()
  2597.   : LONGINT;
  2598.   -384;
  2599. LIBCALL (base : GfxBasePtr) InitBitMap*
  2600.   ( VAR bitMap [8] : BitMap;
  2601.     depth      [0] : SHORTINT;
  2602.     width      [1] : INTEGER;
  2603.     height     [2] : INTEGER );
  2604.   -390;
  2605. LIBCALL (base : GfxBasePtr) ScrollRaster*
  2606.   ( rp   [9] : RastPortPtr;
  2607.     dx   [0] : INTEGER;
  2608.     dy   [1] : INTEGER;
  2609.     xMin [2] : INTEGER;
  2610.     yMin [3] : INTEGER;
  2611.     xMax [4] : INTEGER;
  2612.     yMax [5] : INTEGER );
  2613.   -396;
  2614. LIBCALL (base : GfxBasePtr) WaitBOVP*
  2615.   ( vp [8] : ViewPortPtr );
  2616.   -402;
  2617. LIBCALL (base : GfxBasePtr) GetSprite*
  2618.   ( VAR sprite [8] : SimpleSprite;
  2619.     num        [0] : INTEGER )
  2620.   : INTEGER;
  2621.   -408;
  2622. LIBCALL (base : GfxBasePtr) FreeSprite*
  2623.   ( num [0] : INTEGER );
  2624.   -414;
  2625. LIBCALL (base : GfxBasePtr) ChangeSprite*
  2626.   ( vp         [8] : ViewPortPtr;
  2627.     VAR sprite [9] : SimpleSprite;
  2628.     newData   [10] : PlanePtr );
  2629.   -420;
  2630. LIBCALL (base : GfxBasePtr) MoveSprite*
  2631.   ( vp         [8] : ViewPortPtr;
  2632.     VAR sprite [9] : SimpleSprite;
  2633.     x          [0] : INTEGER;
  2634.     y          [1] : INTEGER );
  2635.   -426;
  2636. LIBCALL (base : GfxBasePtr) LockLayerRom*
  2637.   ( layer [13] : LayerPtr );
  2638.   -432;
  2639. LIBCALL (base : GfxBasePtr) UnlockLayerRom*
  2640.   ( layer [13] : LayerPtr );
  2641.   -438;
  2642. LIBCALL (base : GfxBasePtr) SyncSBitMap*
  2643.   ( layer [8] : LayerPtr );
  2644.   -444;
  2645. LIBCALL (base : GfxBasePtr) CopySBitMap*
  2646.   ( layer [8] : LayerPtr );
  2647.   -450;
  2648. LIBCALL (base : GfxBasePtr) OwnBlitter* ();
  2649.   -456;
  2650. LIBCALL (base : GfxBasePtr) DisownBlitter* ();
  2651.   -462;
  2652. LIBCALL (base : GfxBasePtr) InitTmpRas*
  2653.   ( VAR tmpRas [8] : TmpRas;
  2654.     buffer     [9] : PlanePtr;
  2655.     size       [0] : E.ULONG );
  2656.   -468;
  2657. LIBCALL (base : GfxBasePtr) AskFont*
  2658.   ( rp           [9] : RastPortPtr;
  2659.     VAR textAttr [8] : TextAttr );
  2660.   -474;
  2661. LIBCALL (base : GfxBasePtr) AddFont*
  2662.   ( textFont [9] : TextFontPtr );
  2663.   -480;
  2664. LIBCALL (base : GfxBasePtr) RemFont*
  2665.   ( textFont [9] : TextFontPtr );
  2666.   -486;
  2667. LIBCALL (base : GfxBasePtr) AllocRaster*
  2668.   ( width  [0] : E.UWORD;
  2669.     height [1] : E.UWORD )
  2670.   : PlanePtr;
  2671.   -492;
  2672. LIBCALL (base : GfxBasePtr) FreeRaster*
  2673.   ( p      [8] : PlanePtr;
  2674.     width  [0] : E.UWORD;
  2675.     height [1] : E.UWORD );
  2676.   -498;
  2677. LIBCALL (base : GfxBasePtr) AndRectRegion*
  2678.   ( region        [8] : RegionPtr;
  2679.     VAR rectangle [9] : Rectangle );
  2680.   -504;
  2681. LIBCALL (base : GfxBasePtr) OrRectRegion*
  2682.   ( region        [8] : RegionPtr;
  2683.     VAR rectangle [9] : Rectangle )
  2684.   : BOOLEAN;
  2685.   -510;
  2686. LIBCALL (base : GfxBasePtr) NewRegion* ()
  2687.   : RegionPtr;
  2688.   -516;
  2689. LIBCALL (base : GfxBasePtr) ClearRectRegion*
  2690.   ( region        [8] : RegionPtr;
  2691.     VAR rectangle [9] : Rectangle )
  2692.   : BOOLEAN;
  2693.   -522;
  2694. LIBCALL (base : GfxBasePtr) ClearRegion*
  2695.   ( region [8] : RegionPtr );
  2696.   -528;
  2697. LIBCALL (base : GfxBasePtr) DisposeRegion*
  2698.   ( region [8] : RegionPtr );
  2699.   -534;
  2700. LIBCALL (base : GfxBasePtr) FreeVPortCopLists*
  2701.   ( vp [8] : ViewPortPtr );
  2702.   -540;
  2703. LIBCALL (base : GfxBasePtr) FreeCopList*
  2704.   ( copList [8] : CopListBasePtr );
  2705.   -546;
  2706. LIBCALL (base : GfxBasePtr) ClipBlit* (
  2707.   srcRP   [8] : RastPortPtr;
  2708.   xSrc    [0] : INTEGER;
  2709.   ySrc    [1] : INTEGER;
  2710.   destRP  [9] : RastPortPtr;
  2711.   xDest   [2] : INTEGER;
  2712.   yDest   [3] : INTEGER;
  2713.   xSize   [4] : INTEGER;
  2714.   ySize   [5] : INTEGER;
  2715.   minterm [6] : E.UBYTE );
  2716.   -552;
  2717. LIBCALL (base : GfxBasePtr) XorRectRegion*
  2718.   ( region        [8] : RegionPtr;
  2719.     VAR rectangle [9] : Rectangle )
  2720.   : BOOLEAN;
  2721.   -558;
  2722. LIBCALL (base : GfxBasePtr) FreeCprList*
  2723.   ( cprList [8] : CprlistPtr );
  2724.   -564;
  2725. LIBCALL (base : GfxBasePtr) GetColorMap*
  2726.   ( entries [0] : LONGINT )
  2727.   : ColorMapPtr;
  2728.   -570;
  2729. LIBCALL (base : GfxBasePtr) FreeColorMap*
  2730.   ( colorMap [8] : ColorMapPtr );
  2731.   -576;
  2732. LIBCALL (base : GfxBasePtr) GetRGB4*
  2733.   ( colorMap [8] : ColorMapPtr;
  2734.     entry    [0] : LONGINT )
  2735.   : INTEGER;
  2736.   -582;
  2737. LIBCALL (base : GfxBasePtr) ScrollVPort*
  2738.   ( vp [8] : ViewPortPtr );
  2739.   -588;
  2740. LIBCALL (base : GfxBasePtr) UCopperListInit*
  2741.   ( uCopList [8] : UCopListPtr;
  2742.     n        [0] : LONGINT )
  2743.   : CopListBasePtr;
  2744.   -594;
  2745. LIBCALL (base : GfxBasePtr) FreeGBuffers*
  2746.   ( anOb [8] : AnimObPtr;
  2747.     rp   [9] : RastPortPtr;
  2748.     flag [0] : BOOLEAN );
  2749.   -600;
  2750. LIBCALL (base : GfxBasePtr) BltBitMapRastPort*
  2751.   ( srcBitMap [8] : BitMapPtr;
  2752.     xSrc      [0] : INTEGER;
  2753.     ySrc      [1] : INTEGER;
  2754.     destRP    [9] : RastPortPtr;
  2755.     xDest     [2] : INTEGER;
  2756.     yDest     [3] : INTEGER;
  2757.     xSize     [4] : INTEGER;
  2758.     ySize     [5] : INTEGER;
  2759.     minterm   [6] : E.UBYTE )
  2760.   : BOOLEAN;
  2761.   -606;
  2762. LIBCALL (base : GfxBasePtr) OrRegionRegion*
  2763.   ( srcRegion  [8] : RegionPtr;
  2764.     destRegion [9] : RegionPtr )
  2765.   : BOOLEAN;
  2766.   -612;
  2767. LIBCALL (base : GfxBasePtr) XorRegionRegion*
  2768.   ( srcRegion  [8] : RegionPtr;
  2769.     destRegion [9] : RegionPtr )
  2770.   : BOOLEAN;
  2771.   -618;
  2772. LIBCALL (base : GfxBasePtr) AndRegionRegion*
  2773.   ( srcRegion  [8] : RegionPtr;
  2774.     destRegion [9] : RegionPtr )
  2775.   : BOOLEAN;
  2776.   -624;
  2777. LIBCALL (base : GfxBasePtr) SetRGB4CM* (
  2778.   colorMap [8] : ColorMapPtr;
  2779.   index    [0] : INTEGER;
  2780.   red      [1] : E.UBYTE;
  2781.   green    [2] : E.UBYTE;
  2782.   blue     [3] : E.UBYTE );
  2783.   -630;
  2784. LIBCALL (base : GfxBasePtr) BltMaskBitMapRastPort* (
  2785.   srcBitMap [8] : BitMapPtr;
  2786.   xSrc      [0] : INTEGER;
  2787.   ySrc      [1] : INTEGER;
  2788.   destRP    [9] : RastPortPtr;
  2789.   xDest     [2] : INTEGER;
  2790.   yDest     [3] : INTEGER;
  2791.   xSize     [4] : INTEGER;
  2792.   ySize     [5] : INTEGER;
  2793.   minterm   [6] : E.UBYTE;
  2794.   bltMask  [10] : PlanePtr );
  2795.   -636;
  2796. LIBCALL (base : GfxBasePtr) AttemptLockLayerRom*
  2797.   ( layer [13] : LayerPtr )
  2798.   : BOOLEAN;
  2799.   -654;
  2800.  
  2801. (* --- functions in V36 or higher (distributed as Release 2.0) ---*)
  2802.  
  2803. LIBCALL (base : GfxBasePtr) GfxNew*
  2804.   ( gfxNodeType [0] : E.ULONG )
  2805.   : ExtendedNodePtr;
  2806.   -660;
  2807. LIBCALL (base : GfxBasePtr) GfxFree*
  2808.   ( gfxNodePtr [8] : ExtendedNodePtr );
  2809.   -666;
  2810. LIBCALL (base : GfxBasePtr) GfxAssociate*
  2811.   ( associateNode [8] : ExtendedNodePtr;
  2812.     gfxNodePtr    [9] : ExtendedNodePtr );
  2813.   -672;
  2814. LIBCALL (base : GfxBasePtr) BitMapScale*
  2815.   ( bitScaleArgs [8] : BitScaleArgsPtr );
  2816.   -678;
  2817. LIBCALL (base : GfxBasePtr) ScalerDiv*
  2818.   ( factor      [0] : E.ULONG;
  2819.     numerator   [1] : E.ULONG;
  2820.     denominator [2] : E.ULONG )
  2821.   : E.UWORD;
  2822.   -684;
  2823. LIBCALL (base : GfxBasePtr) TextExtent*
  2824.   ( rp              [9] : RastPortPtr;
  2825.     string          [8] : ARRAY OF CHAR;
  2826.     count           [0] : LONGINT;
  2827.     VAR textExtent [10] : TextExtent )
  2828.   : INTEGER;
  2829.   -690;
  2830. LIBCALL (base : GfxBasePtr) TextFit*
  2831.   ( rp                    [9] : RastPortPtr;
  2832.     string                [8] : ARRAY OF CHAR;
  2833.     strLen                [0] : E.ULONG;
  2834.     textExtent           [10] : TextExtentPtr;
  2835.     constrainingExtent   [11] : TextExtentPtr;
  2836.     strDirection          [1] : LONGINT;
  2837.     constrainingBitWidth  [2] : E.ULONG;
  2838.     constrainingBitHeight [3] : E.ULONG )
  2839.   : E.ULONG;
  2840.   -696;
  2841. LIBCALL (base : GfxBasePtr) GfxLookUp*
  2842.   ( associateNode [8] : ExtendedNodePtr )
  2843.   : E.APTR;
  2844.   -702;
  2845. LIBCALL (base : GfxBasePtr) VideoControlA*
  2846.   ( colorMap [8] : ColorMapPtr;
  2847.     tagarray [9] : ARRAY OF U.TagItem )
  2848.   : BOOLEAN;
  2849.   -708;
  2850. LIBCALL (base : GfxBasePtr) VideoControl*
  2851.   ( colorMap [8]   : ColorMapPtr;
  2852.     tagarray [9].. : U.Tag )
  2853.   : BOOLEAN;
  2854.   -708;
  2855. LIBCALL (base : GfxBasePtr) OpenMonitor*
  2856.   ( monitorName [9] : ARRAY OF CHAR;
  2857.     displayID   [0] : E.ULONG )
  2858.   : MonitorSpecPtr;
  2859.   -714;
  2860. LIBCALL (base : GfxBasePtr) CloseMonitor*
  2861.   ( monitorSpec [8] : MonitorSpecPtr )
  2862.   : BOOLEAN;
  2863.   -720;
  2864. LIBCALL (base : GfxBasePtr) FindDisplayInfo*
  2865.   ( displayID [0] : E.ULONG )
  2866.   : DisplayInfoHandle;
  2867.   -726;
  2868. LIBCALL (base : GfxBasePtr) NextDisplayInfo*
  2869.   ( displayID [0] : E.ULONG )
  2870.   : E.ULONG;
  2871.   -732;
  2872. LIBCALL (base : GfxBasePtr) GetDisplayInfoData*
  2873.   ( handle    [8] : DisplayInfoHandle;
  2874.     VAR buf   [9] : ARRAY OF SYS.BYTE;
  2875.     size      [0] : E.ULONG;
  2876.     tagID     [1] : E.ULONG;
  2877.     displayID [2] : E.ULONG )
  2878.   : E.ULONG;
  2879.   -756;
  2880. LIBCALL (base : GfxBasePtr) FontExtent*
  2881.   ( font           [8] : TextFontPtr;
  2882.     VAR fontExtent [9] : TextExtent );
  2883.   -762;
  2884. LIBCALL (base : GfxBasePtr) ReadPixelLine8*
  2885.   ( rp         [8] : RastPortPtr;
  2886.     xstart     [0] : E.UWORD;
  2887.     ystart     [1] : E.UWORD;
  2888.     width      [2] : E.ULONG;
  2889.     VAR array [10] : ARRAY OF SYS.BYTE;
  2890.     tempRP     [9] : RastPortPtr )
  2891.   : LONGINT;
  2892.   -768;
  2893. LIBCALL (base : GfxBasePtr) WritePixelLine8*
  2894.   ( rp     [8] : RastPortPtr;
  2895.     xstart [0] : E.UWORD;
  2896.     ystart [1] : E.UWORD;
  2897.     width  [2] : E.ULONG;
  2898.     array [10] : ARRAY OF SYS.BYTE;
  2899.     tempRP [9] : RastPortPtr )
  2900.   : LONGINT;
  2901.   -774;
  2902. LIBCALL (base : GfxBasePtr) ReadPixelArray8*
  2903.   ( rp         [8] : RastPortPtr;
  2904.     xstart     [0] : E.UWORD;
  2905.     ystart     [1] : E.UWORD;
  2906.     xstop      [2] : E.UWORD;
  2907.     ystop      [3] : E.UWORD;
  2908.     VAR array [10] : ARRAY OF SYS.BYTE;
  2909.     temprp     [9] : RastPortPtr )
  2910.   : LONGINT;
  2911.   -780;
  2912. LIBCALL (base : GfxBasePtr) WritePixelArray8*
  2913.   ( rp         [8] : RastPortPtr;
  2914.     xstart     [0] : E.UWORD;
  2915.     ystart     [1] : E.UWORD;
  2916.     xstop      [2] : E.UWORD;
  2917.     ystop      [3] : E.UWORD;
  2918.     VAR array [10] : ARRAY OF SYS.BYTE;
  2919.     temprp     [9] : RastPortPtr )
  2920.   : LONGINT;
  2921.   -786;
  2922. LIBCALL (base : GfxBasePtr) GetVPModeID*
  2923.   ( vp [8] : ViewPortPtr )
  2924.   : LONGINT;
  2925.   -792;
  2926. LIBCALL (base : GfxBasePtr) ModeNotAvailable*
  2927.   ( modeID [0] : E.ULONG )
  2928.   : LONGINT;
  2929.   -798;
  2930. LIBCALL (base : GfxBasePtr) WeighTAMatchA*
  2931.   ( VAR reqTextAttr    [8] : TextAttr;
  2932.     VAR targetTextAttr [9] : TextAttr;
  2933.     targetTags        [10] : ARRAY OF U.TagItem )
  2934.   : INTEGER;
  2935.   -804;
  2936. LIBCALL (base : GfxBasePtr) WeighTAMatch*
  2937.   ( VAR reqTextAttr    [8]   : TextAttr;
  2938.     VAR targetTextAttr [9]   : TextAttr;
  2939.     targetTags        [10].. : U.Tag )
  2940.   : INTEGER;
  2941.   -804;
  2942. LIBCALL (base : GfxBasePtr) EraseRect*
  2943.   ( rp   [9] : RastPortPtr;
  2944.     xMin [0] : INTEGER;
  2945.     yMin [1] : INTEGER;
  2946.     xMax [2] : INTEGER;
  2947.     yMax [3] : INTEGER );
  2948.   -810;
  2949. LIBCALL (base : GfxBasePtr) ExtendFontA*
  2950.   ( font     [8] : TextFontPtr;
  2951.     fontTags [9] : ARRAY OF U.TagItem )
  2952.   : E.ULONG;
  2953.   -816;
  2954. LIBCALL (base : GfxBasePtr) ExtendFont*
  2955.   ( font     [8]   : TextFontPtr;
  2956.     fontTags [9].. : U.Tag )
  2957.   : E.ULONG;
  2958.   -816;
  2959. LIBCALL (base : GfxBasePtr) StripFont*
  2960.   ( font [8] : TextFontPtr );
  2961.   -822;
  2962.  
  2963. (*--- functions in V39 or higher (Release 3) ---*)
  2964.  
  2965. LIBCALL (base : GfxBasePtr) CalcIVG  *
  2966.   ( v  [8] : ViewPtr;
  2967.     vp [9] : ViewPortPtr )
  2968.   : E.UWORD;
  2969.   -828;
  2970. LIBCALL (base : GfxBasePtr) AttachPalExtra  *
  2971.   ( cm [8] : ColorMapPtr;
  2972.     vp [9] : ViewPortPtr )
  2973.   : LONGINT;
  2974.   -834;
  2975. LIBCALL (base : GfxBasePtr) ObtainBestPenA  *
  2976.   ( cm   [8] : ColorMapPtr;
  2977.     r    [1] : E.ULONG;
  2978.     g    [2] : E.ULONG;
  2979.     b    [3] : E.ULONG;
  2980.     tags [9] : ARRAY OF U.TagItem )
  2981.   : LONGINT;
  2982.   -840;
  2983. LIBCALL (base : GfxBasePtr) ObtainBestPen  *
  2984.   ( cm   [8]  : ColorMapPtr;
  2985.     r    [1]  : E.ULONG;
  2986.     g    [2]  : E.ULONG;
  2987.     b    [3]  : E.ULONG;
  2988.     tags [9]..: U.Tag )
  2989.   : LONGINT;
  2990.   -840;
  2991. LIBCALL (base : GfxBasePtr) SetRGB32  *
  2992.   ( vp [8] : ViewPortPtr;
  2993.     n  [0] : E.ULONG;
  2994.     r  [1] : E.ULONG;
  2995.     g  [2] : E.ULONG;
  2996.     b  [3] : E.ULONG );
  2997.   -852;
  2998. LIBCALL (base : GfxBasePtr) GetAPen  *
  2999.   ( rp [8] : RastPortPtr )
  3000.   : E.ULONG;
  3001.   -858;
  3002. LIBCALL (base : GfxBasePtr) GetBPen  *
  3003.   ( rp [8] : RastPortPtr )
  3004.   : E.ULONG;
  3005.   -864;
  3006. LIBCALL (base : GfxBasePtr) GetDrMd  *
  3007.   ( rp [8] : RastPortPtr )
  3008.   : SET;
  3009.   -870;
  3010. LIBCALL (base : GfxBasePtr) GetOutlinePen  *
  3011.   ( rp [8] : RastPortPtr )
  3012.   : E.ULONG;
  3013.   -876;
  3014. LIBCALL (base : GfxBasePtr) LoadRGB32  *
  3015.   ( vp        [8] : ViewPortPtr;
  3016.     VAR table [9] : ARRAY OF E.ULONG );
  3017.   -882;
  3018. LIBCALL (base : GfxBasePtr) SetChipRev  *
  3019.   ( want [0] : SET )
  3020.   : SET;
  3021.   -888;
  3022. LIBCALL (base : GfxBasePtr) SetABPenDrMd  *
  3023.   ( rp [9]       : RastPortPtr;
  3024.     apen [0]     : E.ULONG;
  3025.     bpen [1]     : E.ULONG;
  3026.     drawmode [2] : E.BSET );
  3027.   -894;
  3028. LIBCALL (base : GfxBasePtr) GetRGB32  *
  3029.   ( cm         [8] : ColorMapPtr;
  3030.     firstcolor [0] : E.ULONG;
  3031.     ncolors    [1] : E.ULONG;
  3032.     VAR table  [9] : ARRAY OF E.ULONG );
  3033.   -900;
  3034. LIBCALL (base : GfxBasePtr) AllocBitMap  *
  3035.   ( sizex [0]        : E.ULONG;
  3036.     sizey [1]        : E.ULONG;
  3037.     depth [2]        : E.ULONG;
  3038.     flags [3]        : SET;
  3039.     friendBitmap [8] : BitMapPtr )
  3040.   : BitMapPtr;
  3041.   -918;
  3042. LIBCALL (base : GfxBasePtr) FreeBitMap  *
  3043.   ( bm [8] : BitMapPtr );
  3044.   -924;
  3045. LIBCALL (base : GfxBasePtr) GetExtSpriteA  *
  3046.   ( ss  [10] : ExtSpritePtr;
  3047.     tags [9] : ARRAY OF U.TagItem )
  3048.   : LONGINT;
  3049.   -930;
  3050. LIBCALL (base : GfxBasePtr) GetExtSprite  *
  3051.   ( ss  [10]  : ExtSpritePtr;
  3052.     tags [9]..: U.Tag )
  3053.   : LONGINT;
  3054.   -930;
  3055. LIBCALL (base : GfxBasePtr) CoerceMode  *
  3056.   ( vp        [8] : ViewPortPtr;
  3057.     monitorid [0] : E.ULONG;
  3058.     flags     [1] : E.ULONG )
  3059.   : E.ULONG;
  3060.   -936;
  3061. LIBCALL (base : GfxBasePtr) ChangeVPBitMap  *
  3062.   ( vp [8]  : ViewPortPtr;
  3063.     bm [9]  : BitMapPtr;
  3064.     db [10] : DBufInfoPtr );
  3065.   -942;
  3066. LIBCALL (base : GfxBasePtr) ReleasePen  *
  3067.   ( cm [8] : ColorMapPtr;
  3068.     n  [0] : E.ULONG );
  3069.   -948;
  3070. LIBCALL (base : GfxBasePtr) ObtainPen  *
  3071.   ( cm [8] : ColorMapPtr;
  3072.     n  [0] : E.ULONG;
  3073.     r  [1] : E.ULONG;
  3074.     g  [2] : E.ULONG;
  3075.     b  [3] : E.ULONG;
  3076.     f  [4] : LONGINT )
  3077.   : E.ULONG;
  3078.   -954;
  3079. LIBCALL (base : GfxBasePtr) GetBitMapAttr  *
  3080.   ( bm      [8] : BitMapPtr;
  3081.     attrnum [1] : E.ULONG )
  3082.   : E.ULONG;
  3083.   -960;
  3084. LIBCALL (base : GfxBasePtr) AllocDBufInfo  *
  3085.   ( vp [8] : ViewPortPtr )
  3086.   : DBufInfoPtr;
  3087.   -966;
  3088. LIBCALL (base : GfxBasePtr) FreeDBufInfo  *
  3089.   ( dbi [9] : DBufInfoPtr );
  3090.   -972;
  3091. LIBCALL (base : GfxBasePtr) SetOutlinePen  *
  3092.   ( rp  [8] : RastPortPtr;
  3093.     pen [0] : E.ULONG )
  3094.   : E.ULONG;
  3095.   -978;
  3096. LIBCALL (base : GfxBasePtr) SetWriteMask  *
  3097.   ( rp  [8] : RastPortPtr;
  3098.     msk [0] : SET )
  3099.   : BOOLEAN;
  3100.   -984;
  3101. LIBCALL (base : GfxBasePtr) SetMaxPen  *
  3102.   ( rp     [8] : RastPortPtr;
  3103.     maxpen [0] : E.ULONG );
  3104.   -990;
  3105. LIBCALL (base : GfxBasePtr) SetRGB32CM  *
  3106.   ( cm [8] : ColorMapPtr;
  3107.     n  [0] : E.ULONG;
  3108.     r  [1] : E.ULONG;
  3109.     g  [2] : E.ULONG;
  3110.     b  [3] : E.ULONG );
  3111.   -996;
  3112. LIBCALL (base : GfxBasePtr) ScrollRasterBF  *
  3113.   ( rp   [9] : RastPortPtr;
  3114.     dx   [0] : LONGINT;
  3115.     dy   [1] : LONGINT;
  3116.     xMin [2] : LONGINT;
  3117.     yMin [3] : LONGINT;
  3118.     xMax [4] : LONGINT;
  3119.     yMax [5] : LONGINT );
  3120.   -1002;
  3121. LIBCALL (base : GfxBasePtr) FindColor  *
  3122.   ( cm      [11] : ColorMapPtr;
  3123.     r        [1] : E.ULONG;
  3124.     g        [2] : E.ULONG;
  3125.     b        [3] : E.ULONG;
  3126.     maxcolor [4] : LONGINT )
  3127.   : LONGINT;
  3128.   -1008;
  3129. LIBCALL (base : GfxBasePtr) AllocSpriteDataA  *
  3130.   ( bm  [10] : BitMapPtr;
  3131.     tags [9] : ARRAY OF U.TagItem )
  3132.   : ExtSpritePtr;
  3133.   -1020;
  3134. LIBCALL (base : GfxBasePtr) AllocSpriteData  *
  3135.   ( bm  [10]  : BitMapPtr;
  3136.     tags [9]..: U.Tag )
  3137.   : ExtSpritePtr;
  3138.   -1020;
  3139. LIBCALL (base : GfxBasePtr) ChangeExtSpriteA  *
  3140.   ( vp         [8] : ViewPortPtr;
  3141.     oldsprite  [9] : ExtSpritePtr;
  3142.     newsprite [10] : ExtSpritePtr;
  3143.     tags      [11] : ARRAY OF U.TagItem )
  3144.   : LONGINT;
  3145.   -1026;
  3146. LIBCALL (base : GfxBasePtr) ChangeExtSprite  *
  3147.   ( vp         [8]  : ViewPortPtr;
  3148.     oldsprite  [9]  : ExtSpritePtr;
  3149.     newsprite [10]  : ExtSpritePtr;
  3150.     tags      [11]..: U.Tag )
  3151.   : LONGINT;
  3152.   -1026;
  3153. LIBCALL (base : GfxBasePtr) FreeSpriteData  *
  3154.   ( sp [10] : ExtSpritePtr );
  3155.   -1032;
  3156. LIBCALL (base : GfxBasePtr) SetRPAttrsA  *
  3157.   ( rp   [8] : RastPortPtr;
  3158.     tags [9] : ARRAY OF U.TagItem );
  3159.   -1038;
  3160. LIBCALL (base : GfxBasePtr) SetRPAttrs  *
  3161.   ( rp   [8]  : RastPortPtr;
  3162.     tags [9]..: U.Tag );
  3163.   -1038;
  3164. LIBCALL (base : GfxBasePtr) GetRPAttrsA  *
  3165.   ( rp   [8] : RastPortPtr;
  3166.     tags [9] : ARRAY OF U.TagItem );
  3167.   -1044;
  3168. LIBCALL (base : GfxBasePtr) GetRPAttrs  *
  3169.   ( rp   [8]  : RastPortPtr;
  3170.     tags [9]..: U.Tag );
  3171.   -1044;
  3172. LIBCALL (base : GfxBasePtr) BestModeIDA  *
  3173.   ( tags [8] : ARRAY OF U.TagItem )
  3174.   : E.ULONG;
  3175.   -1050;
  3176. LIBCALL (base : GfxBasePtr) BestModeID  *
  3177.   ( tags [8]..: U.Tag )
  3178.   : E.ULONG;
  3179.   -1050;
  3180.  
  3181. (*--- functions in V40 or higher (Release 3.1) ---*)
  3182.  
  3183. LIBCALL (base : GfxBasePtr) WriteChunkyPixels  *
  3184.   ( rp          [8] : RastPortPtr;
  3185.     xstart      [0] : E.ULONG;
  3186.     ystart      [1] : E.ULONG;
  3187.     xstop       [2] : E.ULONG;
  3188.     ystop       [3] : E.ULONG;
  3189.     array      [10] : ARRAY OF SYS.BYTE;
  3190.     bytesperrow [4] : LONGINT );
  3191.   -1056;
  3192.  
  3193. (**-- C Macros defined as procedures -----------------------------------*)
  3194. (** $L+ Absolute long addressing for globals *)
  3195.  
  3196. (*
  3197. **      $VER: gfxmacros.h 39.3 (31.5.93)
  3198. *)
  3199.  
  3200. (**-----------------------------------*)
  3201. (* This macro is obsolete as of V39. AllocBitMap() should be used for allocating
  3202.    bitmap data, since it knows about the machine's particular alignment
  3203.    restrictions.
  3204. *)
  3205. PROCEDURE RASSIZE* (w, h : INTEGER) : LONGINT;
  3206.  
  3207. BEGIN (* RASSIZE *)
  3208.   RETURN ( h * (((LONG (w) + 15) DIV 16) * 2))
  3209. END RASSIZE;
  3210.  
  3211. (**-----------------------------------*)
  3212. PROCEDURE OnDisplay* ();
  3213.  
  3214. BEGIN (* OnDisplay *)
  3215.   H.custom.dmacon := {H.dmaSetClr, H.dmaRaster}
  3216. END OnDisplay;
  3217.  
  3218. (**-----------------------------------*)
  3219. PROCEDURE OffDisplay* ();
  3220.  
  3221. BEGIN (* OffDisplay *)
  3222.   H.custom.dmacon := {H.dmaRaster}
  3223. END OffDisplay;
  3224.  
  3225. (**-----------------------------------*)
  3226. PROCEDURE OnSprite* ();
  3227.  
  3228. BEGIN (* OnSprite *)
  3229.   H.custom.dmacon := {H.dmaSetClr, H.dmaSprite}
  3230. END OnSprite;
  3231.  
  3232. (**-----------------------------------*)
  3233. PROCEDURE OffSprite* ();
  3234.  
  3235. BEGIN (* OffSprite *)
  3236.   H.custom.dmacon := {H.dmaSprite}
  3237. END OffSprite;
  3238.  
  3239. (**-----------------------------------*)
  3240. PROCEDURE OnVBlank* ();
  3241.  
  3242. BEGIN (* OnVBlank *)
  3243.   H.custom.intena := {H.intSetClr, H.intVertB}
  3244. END OnVBlank;
  3245.  
  3246. (**-----------------------------------*)
  3247. PROCEDURE OffVBlank* ();
  3248.  
  3249. BEGIN (* OffVBlank *)
  3250.   H.custom.intena := {H.intVertB}
  3251. END OffVBlank;
  3252.  
  3253.  
  3254. (**-----------------------------------*)
  3255. PROCEDURE SetDrPt* (w : RastPortPtr; p : E.UWORD);
  3256.  
  3257. BEGIN (* SetDrPt *)
  3258.   w.linePtrn := p; INCL (w.flags, frstDot); w.linpatcnt := 15
  3259. END SetDrPt;
  3260.  
  3261. (**-----------------------------------*)
  3262. PROCEDURE SetAfPt* (w : RastPortPtr; p : E.APTR; n : SHORTINT);
  3263.  
  3264. BEGIN (* SetAfPt *)
  3265.   w.areaPtrn := p; w.areaPtSz := n
  3266. END SetAfPt;
  3267.  
  3268. (**-----------------------------------*)
  3269. PROCEDURE SetOPen* (w : RastPortPtr; c : SHORTINT);
  3270.  
  3271. BEGIN (* SetOPen *)
  3272.   w.aOlPen := c; INCL (w.flags, areaOutline)
  3273. END SetOPen;
  3274.  
  3275. (**-----------------------------------*)
  3276. PROCEDURE SetWrMsk* (w : RastPortPtr; m : E.BSET);
  3277.  
  3278. BEGIN (* SetWrMsk *)
  3279.   w.mask := m
  3280. END SetWrMsk;
  3281.  
  3282. (* the SafeSetxxx macros are backwards (pre V39 graphics) compatible versions *)
  3283. (* using these macros will make your code do the right thing under V39 AND V37 *)
  3284. (**-----------------------------------*)
  3285. PROCEDURE SafeSetOutlinePen* (w : RastPortPtr; c : SHORTINT);
  3286.   VAR ignore : LONGINT;
  3287. BEGIN (* SafeSetOutlinePen *)
  3288.   IF base.version < 39 THEN
  3289.     w.aOlPen := c; INCL (w.flags, areaOutline)
  3290.   ELSE
  3291.     ignore := base.SetOutlinePen (w, c)
  3292.   END
  3293. END SafeSetOutlinePen;
  3294.  
  3295. (**-----------------------------------*)
  3296. PROCEDURE SafeSetWriteMask* (w : RastPortPtr; m : E.BSET);
  3297.   VAR ignore : BOOLEAN;
  3298. BEGIN (* SafeSetWriteMask *)
  3299.   IF base.version < 39 THEN
  3300.     w.mask := m
  3301.   ELSE
  3302.     ignore := base.SetWriteMask (w, LONG (LONG (m)))
  3303.   END
  3304. END SafeSetWriteMask;
  3305.  
  3306. (**-----------------------------------*)
  3307. PROCEDURE BndryOff* (VAR w : RastPort);
  3308.  
  3309. BEGIN (* BndryOff *)
  3310.   EXCL (w.flags, areaOutline)
  3311. END BndryOff;
  3312.  
  3313. (**-----------------------------------*)
  3314. PROCEDURE (VAR base : GfxBase) CINIT* (c : UCopListPtr; n : LONGINT);
  3315.  
  3316. BEGIN (* CINIT *)
  3317.   SYS.PUTREG (0, base.UCopperListInit (c, n))
  3318. END CINIT;
  3319.  
  3320. (**-----------------------------------*)
  3321. PROCEDURE (VAR base : GfxBase) CMOVE*
  3322.   (c : UCopListPtr; a : E.APTR; b : E.UWORD );
  3323.  
  3324. BEGIN (* CMOVE *)
  3325.   base.CMove (c, a, b); base.CBump (c)
  3326. END CMOVE;
  3327.  
  3328. (**-----------------------------------*)
  3329. PROCEDURE (VAR base : GfxBase) CWAIT*
  3330.   (c : UCopListPtr; a : INTEGER; b : INTEGER );
  3331.  
  3332. BEGIN (* CWAIT *)
  3333.   base.CWait (c, a, b); base.CBump (c)
  3334. END CWAIT;
  3335.  
  3336. (**-----------------------------------*)
  3337. PROCEDURE (VAR base : GfxBase) CEND* (c : UCopListPtr);
  3338.  
  3339. BEGIN (* CEND *)
  3340.  base.CWAIT (c, 10000, 255)
  3341. END CEND;
  3342.  
  3343.  
  3344. (**-----------------------------------*)
  3345. PROCEDURE (VAR base : GfxBase) DrawCircle*
  3346.   (rp : RastPortPtr; cx, cy, r : INTEGER);
  3347.  
  3348. BEGIN (* DrawCircle *)
  3349.   base.DrawEllipse (rp, cx, cy, r, r)
  3350. END DrawCircle;
  3351.  
  3352.  
  3353. (**-----------------------------------*)
  3354. PROCEDURE (VAR base : GfxBase) AreaCircle*
  3355.   (rp : RastPortPtr; cx, cy, r : INTEGER)
  3356.   : BOOLEAN;
  3357.  
  3358. BEGIN (* AreaCircle *)
  3359.   RETURN base.AreaEllipse (rp, cx, cy, r, r)
  3360. END AreaCircle;
  3361.  
  3362. (** $L-*)
  3363.  
  3364.  
  3365. (**-- Library Base Variable --------------------------------------------*)
  3366.  
  3367.  
  3368. PROCEDURE* Close ();
  3369.  
  3370. BEGIN (* Close *)
  3371.   IF base # NIL THEN E.base.CloseLibrary (base) END;
  3372. END Close;
  3373.  
  3374. BEGIN (* Graphics *)
  3375.   base :=
  3376.     SYS.VAL (
  3377.       GfxBasePtr,
  3378.       E.base.OpenLibrary (name, E.libraryMinimum));
  3379.   IF base = NIL THEN HALT (100) END;
  3380.   SYS.SETCLEANUP (Close)
  3381. END Graphics.
  3382.